Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 132 additions & 0 deletions dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/GetTextArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
// <auto-generated>
// Auto-generated by StoneAPI, do not modify.
// </auto-generated>

namespace Dropbox.Api.Riviera
{
using sys = System;
using col = System.Collections.Generic;
using re = System.Text.RegularExpressions;

using enc = Dropbox.Api.Stone;

/// <summary>
/// <para>Arguments for the asynchronous `get_text_async` route. Exactly one of `file_id`,
/// `path`, or `url` must be supplied via `file_id_or_url` to identify the document whose
/// plain-text content should be extracted.</para>
/// </summary>
public class GetTextArgs
{
#pragma warning disable 108

/// <summary>
/// <para>The encoder instance.</para>
/// </summary>
internal static enc.StructEncoder<GetTextArgs> Encoder = new GetTextArgsEncoder();

/// <summary>
/// <para>The decoder instance.</para>
/// </summary>
internal static enc.StructDecoder<GetTextArgs> Decoder = new GetTextArgsDecoder();

/// <summary>
/// <para>Initializes a new instance of the <see cref="GetTextArgs" /> class.</para>
/// </summary>
/// <param name="fileIdOrUrl">Identifier of the document to extract text from. Callers
/// must set exactly one of the `FileIdOrUrl` variants. Text extraction is supported
/// for common document formats (Word, PowerPoint, Excel, PDF, RTF, and Dropbox
/// document types); see the route description for the supported formats. Requests
/// against unsupported formats return `unsupported_format_error`. NOTE: for the `url`
/// variant, only Dropbox shared links (www.dropbox.com) are supported. External
/// (non-Dropbox) URLs are not supported and return `unsupported_format_error`; import
/// the file into Dropbox and reference it by `file_id` or `path` instead.</param>
public GetTextArgs(FileIdOrUrl fileIdOrUrl = null)
{
this.FileIdOrUrl = fileIdOrUrl;
}

/// <summary>
/// <para>Initializes a new instance of the <see cref="GetTextArgs" /> class.</para>
/// </summary>
/// <remarks>This is to construct an instance of the object when
/// deserializing.</remarks>
[sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)]
public GetTextArgs()
{
}

/// <summary>
/// <para>Identifier of the document to extract text from. Callers must set exactly one
/// of the `FileIdOrUrl` variants. Text extraction is supported for common document
/// formats (Word, PowerPoint, Excel, PDF, RTF, and Dropbox document types); see the
/// route description for the supported formats. Requests against unsupported formats
/// return `unsupported_format_error`. NOTE: for the `url` variant, only Dropbox shared
/// links (www.dropbox.com) are supported. External (non-Dropbox) URLs are not
/// supported and return `unsupported_format_error`; import the file into Dropbox and
/// reference it by `file_id` or `path` instead.</para>
/// </summary>
public FileIdOrUrl FileIdOrUrl { get; protected set; }

#region Encoder class

/// <summary>
/// <para>Encoder for <see cref="GetTextArgs" />.</para>
/// </summary>
private class GetTextArgsEncoder : enc.StructEncoder<GetTextArgs>
{
/// <summary>
/// <para>Encode fields of given value.</para>
/// </summary>
/// <param name="value">The value.</param>
/// <param name="writer">The writer.</param>
public override void EncodeFields(GetTextArgs value, enc.IJsonWriter writer)
{
if (value.FileIdOrUrl != null)
{
WriteProperty("file_id_or_url", value.FileIdOrUrl, writer, global::Dropbox.Api.Riviera.FileIdOrUrl.Encoder);
}
}
}

#endregion


#region Decoder class

/// <summary>
/// <para>Decoder for <see cref="GetTextArgs" />.</para>
/// </summary>
private class GetTextArgsDecoder : enc.StructDecoder<GetTextArgs>
{
/// <summary>
/// <para>Create a new instance of type <see cref="GetTextArgs" />.</para>
/// </summary>
/// <returns>The struct instance.</returns>
protected override GetTextArgs Create()
{
return new GetTextArgs();
}

/// <summary>
/// <para>Set given field.</para>
/// </summary>
/// <param name="value">The field value.</param>
/// <param name="fieldName">The field name.</param>
/// <param name="reader">The json reader.</param>
protected override void SetField(GetTextArgs value, string fieldName, enc.IJsonReader reader)
{
switch (fieldName)
{
case "file_id_or_url":
value.FileIdOrUrl = global::Dropbox.Api.Riviera.FileIdOrUrl.Decoder.Decode(reader);
break;
default:
reader.Skip();
break;
}
}
}

#endregion
}
}
Loading