diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/GetTextArgs.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/GetTextArgs.cs new file mode 100644 index 0000000000..c56367674b --- /dev/null +++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/GetTextArgs.cs @@ -0,0 +1,132 @@ +// +// Auto-generated by StoneAPI, do not modify. +// + +namespace Dropbox.Api.Riviera +{ + using sys = System; + using col = System.Collections.Generic; + using re = System.Text.RegularExpressions; + + using enc = Dropbox.Api.Stone; + + /// + /// 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. + /// + public class GetTextArgs + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new GetTextArgsEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new GetTextArgsDecoder(); + + /// + /// Initializes a new instance of the class. + /// + /// 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. + public GetTextArgs(FileIdOrUrl fileIdOrUrl = null) + { + this.FileIdOrUrl = fileIdOrUrl; + } + + /// + /// Initializes a new instance of the class. + /// + /// This is to construct an instance of the object when + /// deserializing. + [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] + public GetTextArgs() + { + } + + /// + /// 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. + /// + public FileIdOrUrl FileIdOrUrl { get; protected set; } + + #region Encoder class + + /// + /// Encoder for . + /// + private class GetTextArgsEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + 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 + + /// + /// Decoder for . + /// + private class GetTextArgsDecoder : enc.StructDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override GetTextArgs Create() + { + return new GetTextArgs(); + } + + /// + /// Set given field. + /// + /// The field value. + /// The field name. + /// The json reader. + 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 + } +} diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/GetTextAsyncCheckResult.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/GetTextAsyncCheckResult.cs new file mode 100644 index 0000000000..1878b93922 --- /dev/null +++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/GetTextAsyncCheckResult.cs @@ -0,0 +1,532 @@ +// +// Auto-generated by StoneAPI, do not modify. +// + +namespace Dropbox.Api.Riviera +{ + using sys = System; + using col = System.Collections.Generic; + using re = System.Text.RegularExpressions; + + using enc = Dropbox.Api.Stone; + + /// + /// Result type for EventBus async check - must end in "CheckResult" + /// + public class GetTextAsyncCheckResult + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new GetTextAsyncCheckResultEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new GetTextAsyncCheckResultDecoder(); + + /// + /// Initializes a new instance of the + /// class. + /// + public GetTextAsyncCheckResult() + { + } + + /// + /// Gets a value indicating whether this instance is InProgress + /// + public bool IsInProgress + { + get + { + return this is InProgress; + } + } + + /// + /// Gets this instance as a InProgress, or null. + /// + public InProgress AsInProgress + { + get + { + return this as InProgress; + } + } + + /// + /// Gets a value indicating whether this instance is Complete + /// + public bool IsComplete + { + get + { + return this is Complete; + } + } + + /// + /// Gets this instance as a Complete, or null. + /// + public Complete AsComplete + { + get + { + return this as Complete; + } + } + + /// + /// Gets a value indicating whether this instance is Failed + /// + public bool IsFailed + { + get + { + return this is Failed; + } + } + + /// + /// Gets this instance as a Failed, or null. + /// + public Failed AsFailed + { + get + { + return this as Failed; + } + } + + /// + /// Gets a value indicating whether this instance is Other + /// + public bool IsOther + { + get + { + return this is Other; + } + } + + /// + /// Gets this instance as a Other, or null. + /// + public Other AsOther + { + get + { + return this as Other; + } + } + + #region Encoder class + + /// + /// Encoder for . + /// + private class GetTextAsyncCheckResultEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + public override void EncodeFields(GetTextAsyncCheckResult value, enc.IJsonWriter writer) + { + if (value is InProgress) + { + WriteProperty(".tag", "in_progress", writer, enc.StringEncoder.Instance); + InProgress.Encoder.EncodeFields((InProgress)value, writer); + return; + } + if (value is Complete) + { + WriteProperty(".tag", "complete", writer, enc.StringEncoder.Instance); + Complete.Encoder.EncodeFields((Complete)value, writer); + return; + } + if (value is Failed) + { + WriteProperty(".tag", "failed", writer, enc.StringEncoder.Instance); + Failed.Encoder.EncodeFields((Failed)value, writer); + return; + } + if (value is Other) + { + WriteProperty(".tag", "other", writer, enc.StringEncoder.Instance); + Other.Encoder.EncodeFields((Other)value, writer); + return; + } + throw new sys.InvalidOperationException(); + } + } + + #endregion + + #region Decoder class + + /// + /// Decoder for . + /// + private class GetTextAsyncCheckResultDecoder : enc.UnionDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override GetTextAsyncCheckResult Create() + { + return new GetTextAsyncCheckResult(); + } + + /// + /// Decode based on given tag. + /// + /// The tag. + /// The json reader. + /// The decoded object. + protected override GetTextAsyncCheckResult Decode(string tag, enc.IJsonReader reader) + { + switch (tag) + { + case "in_progress": + return InProgress.Decoder.DecodeFields(reader); + case "complete": + return Complete.Decoder.DecodeFields(reader); + case "failed": + return Failed.Decoder.DecodeFields(reader); + default: + return Other.Decoder.DecodeFields(reader); + } + } + } + + #endregion + + /// + /// The in progress object + /// + public sealed class InProgress : GetTextAsyncCheckResult + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new InProgressEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new InProgressDecoder(); + + /// + /// Initializes a new instance of the class. + /// + private InProgress() + { + } + + /// + /// A singleton instance of InProgress + /// + public static readonly InProgress Instance = new InProgress(); + + #region Encoder class + + /// + /// Encoder for . + /// + private class InProgressEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + public override void EncodeFields(InProgress value, enc.IJsonWriter writer) + { + } + } + + #endregion + + #region Decoder class + + /// + /// Decoder for . + /// + private class InProgressDecoder : enc.StructDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override InProgress Create() + { + return InProgress.Instance; + } + + } + + #endregion + } + + /// + /// The complete object + /// + public sealed class Complete : GetTextAsyncCheckResult + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new CompleteEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new CompleteDecoder(); + + /// + /// Initializes a new instance of the class. + /// + /// The value + public Complete(GetTextResult value) + { + this.Value = value; + } + /// + /// Initializes a new instance of the class. + /// + private Complete() + { + } + + /// + /// Gets the value of this instance. + /// + public GetTextResult Value { get; private set; } + + #region Encoder class + + /// + /// Encoder for . + /// + private class CompleteEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + public override void EncodeFields(Complete value, enc.IJsonWriter writer) + { + WriteProperty("complete", value.Value, writer, global::Dropbox.Api.Riviera.GetTextResult.Encoder); + } + } + + #endregion + + #region Decoder class + + /// + /// Decoder for . + /// + private class CompleteDecoder : enc.StructDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override Complete Create() + { + return new Complete(); + } + + /// + /// Decode fields without ensuring start and end object. + /// + /// The json reader. + /// The decoded object. + public override Complete DecodeFields(enc.IJsonReader reader) + { + return new Complete(global::Dropbox.Api.Riviera.GetTextResult.Decoder.DecodeFields(reader)); + } + } + + #endregion + } + + /// + /// The failed object + /// + public sealed class Failed : GetTextAsyncCheckResult + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new FailedEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new FailedDecoder(); + + /// + /// Initializes a new instance of the class. + /// + /// The value + public Failed(TextExtractionApiV2Error value) + { + this.Value = value; + } + /// + /// Initializes a new instance of the class. + /// + private Failed() + { + } + + /// + /// Gets the value of this instance. + /// + public TextExtractionApiV2Error Value { get; private set; } + + #region Encoder class + + /// + /// Encoder for . + /// + private class FailedEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + public override void EncodeFields(Failed value, enc.IJsonWriter writer) + { + WriteProperty("failed", value.Value, writer, global::Dropbox.Api.Riviera.TextExtractionApiV2Error.Encoder); + } + } + + #endregion + + #region Decoder class + + /// + /// Decoder for . + /// + private class FailedDecoder : enc.StructDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override Failed Create() + { + return new Failed(); + } + + /// + /// Set given field. + /// + /// The field value. + /// The field name. + /// The json reader. + protected override void SetField(Failed value, string fieldName, enc.IJsonReader reader) + { + switch (fieldName) + { + case "failed": + value.Value = global::Dropbox.Api.Riviera.TextExtractionApiV2Error.Decoder.Decode(reader); + break; + default: + reader.Skip(); + break; + } + } + } + + #endregion + } + + /// + /// The other object + /// + public sealed class Other : GetTextAsyncCheckResult + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new OtherEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new OtherDecoder(); + + /// + /// Initializes a new instance of the class. + /// + private Other() + { + } + + /// + /// A singleton instance of Other + /// + public static readonly Other Instance = new Other(); + + #region Encoder class + + /// + /// Encoder for . + /// + private class OtherEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + public override void EncodeFields(Other value, enc.IJsonWriter writer) + { + } + } + + #endregion + + #region Decoder class + + /// + /// Decoder for . + /// + private class OtherDecoder : enc.StructDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override Other Create() + { + return Other.Instance; + } + + } + + #endregion + } + } +} diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/GetTextResult.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/GetTextResult.cs new file mode 100644 index 0000000000..7a97a9f6dc --- /dev/null +++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/GetTextResult.cs @@ -0,0 +1,123 @@ +// +// Auto-generated by StoneAPI, do not modify. +// + +namespace Dropbox.Api.Riviera +{ + using sys = System; + using col = System.Collections.Generic; + using re = System.Text.RegularExpressions; + + using enc = Dropbox.Api.Stone; + + /// + /// The get text result object + /// + public class GetTextResult + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new GetTextResultEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new GetTextResultDecoder(); + + /// + /// Initializes a new instance of the class. + /// + /// The plain-text content extracted from the document. For + /// multi-page documents the text is concatenated in document order. May be empty when + /// no text is detected in the source. + public GetTextResult(string text = "") + { + if (text == null) + { + throw new sys.ArgumentNullException("text"); + } + + this.Text = text; + } + + /// + /// Initializes a new instance of the class. + /// + /// This is to construct an instance of the object when + /// deserializing. + [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] + public GetTextResult() + { + this.Text = ""; + } + + /// + /// The plain-text content extracted from the document. For multi-page documents + /// the text is concatenated in document order. May be empty when no text is detected + /// in the source. + /// + public string Text { get; protected set; } + + #region Encoder class + + /// + /// Encoder for . + /// + private class GetTextResultEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + public override void EncodeFields(GetTextResult value, enc.IJsonWriter writer) + { + WriteProperty("text", value.Text, writer, enc.StringEncoder.Instance); + } + } + + #endregion + + + #region Decoder class + + /// + /// Decoder for . + /// + private class GetTextResultDecoder : enc.StructDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override GetTextResult Create() + { + return new GetTextResult(); + } + + /// + /// Set given field. + /// + /// The field value. + /// The field name. + /// The json reader. + protected override void SetField(GetTextResult value, string fieldName, enc.IJsonReader reader) + { + switch (fieldName) + { + case "text": + value.Text = enc.StringDecoder.Instance.Decode(reader); + break; + default: + reader.Skip(); + break; + } + } + } + + #endregion + } +} diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/RivieraAppRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/RivieraAppRoutes.cs index 6e40e555a2..4a8c8f1825 100644 --- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/RivieraAppRoutes.cs +++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/RivieraAppRoutes.cs @@ -414,6 +414,195 @@ public GetMetadataAsyncCheckResult EndGetMetadataAsyncCheck(sys.IAsyncResult asy return task.Result; } + /// + /// Asynchronous plain-text extraction from documents. Supported formats include: + /// - Word processing: .doc, .docx, .docm, .rtf. - Presentations: .ppt, .pptx, .pptm. - + /// Spreadsheets: .xls, .xlsx, .xlsm. - PDF: .pdf. - Dropbox document types: .paper, + /// .papert, .binder, .gdoc, .gsheet, .gslides. - Plain text / subtitles: .txt, .vtt. + /// Unsupported formats return an `unsupported_format_error`. For the `url` variant + /// only Dropbox shared links are supported; external URLs return + /// `unsupported_format_error`. + /// + /// The request parameters + /// The task that represents the asynchronous send operation. The TResult + /// parameter contains the response from the server. + public t.Task GetTextAsyncAsync(GetTextArgs getTextArgs) + { + return this.Transport.SendRpcRequestAsync(getTextArgs, "api", "/riviera/get_text_async", "app", global::Dropbox.Api.Riviera.GetTextArgs.Encoder, global::Dropbox.Api.Async.LaunchResultBase.Decoder, enc.EmptyDecoder.Instance); + } + + /// + /// Begins an asynchronous send to the get text async route. + /// + /// The request parameters. + /// The method to be called when the asynchronous send is + /// completed. + /// A user provided object that distinguished this send from other + /// send requests. + /// An object that represents the asynchronous send request. + public sys.IAsyncResult BeginGetTextAsync(GetTextArgs getTextArgs, sys.AsyncCallback callback, object state = null) + { + var task = this.GetTextAsyncAsync(getTextArgs); + + return enc.Util.ToApm(task, callback, state); + } + + /// + /// Asynchronous plain-text extraction from documents. Supported formats include: + /// - Word processing: .doc, .docx, .docm, .rtf. - Presentations: .ppt, .pptx, .pptm. - + /// Spreadsheets: .xls, .xlsx, .xlsm. - PDF: .pdf. - Dropbox document types: .paper, + /// .papert, .binder, .gdoc, .gsheet, .gslides. - Plain text / subtitles: .txt, .vtt. + /// Unsupported formats return an `unsupported_format_error`. For the `url` variant + /// only Dropbox shared links are supported; external URLs return + /// `unsupported_format_error`. + /// + /// 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. + /// The task that represents the asynchronous send operation. The TResult + /// parameter contains the response from the server. + public t.Task GetTextAsyncAsync(FileIdOrUrl fileIdOrUrl = null) + { + var getTextArgs = new GetTextArgs(fileIdOrUrl); + + return this.GetTextAsyncAsync(getTextArgs); + } + + /// + /// Begins an asynchronous send to the get text async route. + /// + /// 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. + /// The method to be called when the asynchronous send is + /// completed. + /// A user provided object that distinguished this send + /// from other send requests. + /// An object that represents the asynchronous send request. + public sys.IAsyncResult BeginGetTextAsync(FileIdOrUrl fileIdOrUrl = null, + sys.AsyncCallback callback = null, + object callbackState = null) + { + var getTextArgs = new GetTextArgs(fileIdOrUrl); + + return this.BeginGetTextAsync(getTextArgs, callback, callbackState); + } + + /// + /// Waits for the pending asynchronous send to the get text async route to + /// complete + /// + /// The reference to the pending asynchronous send + /// request + /// The response to the send request + public global::Dropbox.Api.Async.LaunchResultBase EndGetTextAsync(sys.IAsyncResult asyncResult) + { + var task = asyncResult as t.Task; + if (task == null) + { + throw new sys.InvalidOperationException(); + } + + return task.Result; + } + + /// + /// Returns the status or result of specified get_text_async task. + /// + /// The request parameters + /// The task that represents the asynchronous send operation. The TResult + /// parameter contains the response from the server. + /// Thrown if there is an error + /// processing the request; This will contain a . + public t.Task GetTextAsyncCheckAsync(global::Dropbox.Api.Async.PollArg pollArg) + { + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/riviera/get_text_async/check", "app", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Riviera.GetTextAsyncCheckResult.Decoder, global::Dropbox.Api.Async.PollError.Decoder); + } + + /// + /// Begins an asynchronous send to the get text async check route. + /// + /// The request parameters. + /// The method to be called when the asynchronous send is + /// completed. + /// A user provided object that distinguished this send from other + /// send requests. + /// An object that represents the asynchronous send request. + public sys.IAsyncResult BeginGetTextAsyncCheck(global::Dropbox.Api.Async.PollArg pollArg, sys.AsyncCallback callback, object state = null) + { + var task = this.GetTextAsyncCheckAsync(pollArg); + + return enc.Util.ToApm(task, callback, state); + } + + /// + /// Returns the status or result of specified get_text_async task. + /// + /// Id of the asynchronous job. This is the value of a + /// response returned from the method that launched the job. + /// The task that represents the asynchronous send operation. The TResult + /// parameter contains the response from the server. + /// Thrown if there is an error + /// processing the request; This will contain a . + public t.Task GetTextAsyncCheckAsync(string asyncJobId) + { + var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); + + return this.GetTextAsyncCheckAsync(pollArg); + } + + /// + /// Begins an asynchronous send to the get text async check route. + /// + /// Id of the asynchronous job. This is the value of a + /// response returned from the method that launched the job. + /// The method to be called when the asynchronous send is + /// completed. + /// A user provided object that distinguished this send + /// from other send requests. + /// An object that represents the asynchronous send request. + public sys.IAsyncResult BeginGetTextAsyncCheck(string asyncJobId, + sys.AsyncCallback callback, + object callbackState = null) + { + var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); + + return this.BeginGetTextAsyncCheck(pollArg, callback, callbackState); + } + + /// + /// Waits for the pending asynchronous send to the get text async check route to + /// complete + /// + /// The reference to the pending asynchronous send + /// request + /// The response to the send request + /// Thrown if there is an error + /// processing the request; This will contain a . + public GetTextAsyncCheckResult EndGetTextAsyncCheck(sys.IAsyncResult asyncResult) + { + var task = asyncResult as t.Task; + if (task == null) + { + throw new sys.InvalidOperationException(); + } + + return task.Result; + } + /// /// Asynchronous transcript generation for audio and video files. Supported audio /// formats: .aac, .aif, .aiff, .flac, .m4a, .m4r, .mp3, .oga, .ogg, .wav, .wma. diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/RivieraUserRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/RivieraUserRoutes.cs index 724347a5e4..3446f0a2d5 100644 --- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/RivieraUserRoutes.cs +++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/RivieraUserRoutes.cs @@ -414,6 +414,195 @@ public GetMetadataAsyncCheckResult EndGetMetadataAsyncCheck(sys.IAsyncResult asy return task.Result; } + /// + /// Asynchronous plain-text extraction from documents. Supported formats include: + /// - Word processing: .doc, .docx, .docm, .rtf. - Presentations: .ppt, .pptx, .pptm. - + /// Spreadsheets: .xls, .xlsx, .xlsm. - PDF: .pdf. - Dropbox document types: .paper, + /// .papert, .binder, .gdoc, .gsheet, .gslides. - Plain text / subtitles: .txt, .vtt. + /// Unsupported formats return an `unsupported_format_error`. For the `url` variant + /// only Dropbox shared links are supported; external URLs return + /// `unsupported_format_error`. + /// + /// The request parameters + /// The task that represents the asynchronous send operation. The TResult + /// parameter contains the response from the server. + public t.Task GetTextAsyncAsync(GetTextArgs getTextArgs) + { + return this.Transport.SendRpcRequestAsync(getTextArgs, "api", "/riviera/get_text_async", "user", global::Dropbox.Api.Riviera.GetTextArgs.Encoder, global::Dropbox.Api.Async.LaunchResultBase.Decoder, enc.EmptyDecoder.Instance); + } + + /// + /// Begins an asynchronous send to the get text async route. + /// + /// The request parameters. + /// The method to be called when the asynchronous send is + /// completed. + /// A user provided object that distinguished this send from other + /// send requests. + /// An object that represents the asynchronous send request. + public sys.IAsyncResult BeginGetTextAsync(GetTextArgs getTextArgs, sys.AsyncCallback callback, object state = null) + { + var task = this.GetTextAsyncAsync(getTextArgs); + + return enc.Util.ToApm(task, callback, state); + } + + /// + /// Asynchronous plain-text extraction from documents. Supported formats include: + /// - Word processing: .doc, .docx, .docm, .rtf. - Presentations: .ppt, .pptx, .pptm. - + /// Spreadsheets: .xls, .xlsx, .xlsm. - PDF: .pdf. - Dropbox document types: .paper, + /// .papert, .binder, .gdoc, .gsheet, .gslides. - Plain text / subtitles: .txt, .vtt. + /// Unsupported formats return an `unsupported_format_error`. For the `url` variant + /// only Dropbox shared links are supported; external URLs return + /// `unsupported_format_error`. + /// + /// 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. + /// The task that represents the asynchronous send operation. The TResult + /// parameter contains the response from the server. + public t.Task GetTextAsyncAsync(FileIdOrUrl fileIdOrUrl = null) + { + var getTextArgs = new GetTextArgs(fileIdOrUrl); + + return this.GetTextAsyncAsync(getTextArgs); + } + + /// + /// Begins an asynchronous send to the get text async route. + /// + /// 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. + /// The method to be called when the asynchronous send is + /// completed. + /// A user provided object that distinguished this send + /// from other send requests. + /// An object that represents the asynchronous send request. + public sys.IAsyncResult BeginGetTextAsync(FileIdOrUrl fileIdOrUrl = null, + sys.AsyncCallback callback = null, + object callbackState = null) + { + var getTextArgs = new GetTextArgs(fileIdOrUrl); + + return this.BeginGetTextAsync(getTextArgs, callback, callbackState); + } + + /// + /// Waits for the pending asynchronous send to the get text async route to + /// complete + /// + /// The reference to the pending asynchronous send + /// request + /// The response to the send request + public global::Dropbox.Api.Async.LaunchResultBase EndGetTextAsync(sys.IAsyncResult asyncResult) + { + var task = asyncResult as t.Task; + if (task == null) + { + throw new sys.InvalidOperationException(); + } + + return task.Result; + } + + /// + /// Returns the status or result of specified get_text_async task. + /// + /// The request parameters + /// The task that represents the asynchronous send operation. The TResult + /// parameter contains the response from the server. + /// Thrown if there is an error + /// processing the request; This will contain a . + public t.Task GetTextAsyncCheckAsync(global::Dropbox.Api.Async.PollArg pollArg) + { + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/riviera/get_text_async/check", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Riviera.GetTextAsyncCheckResult.Decoder, global::Dropbox.Api.Async.PollError.Decoder); + } + + /// + /// Begins an asynchronous send to the get text async check route. + /// + /// The request parameters. + /// The method to be called when the asynchronous send is + /// completed. + /// A user provided object that distinguished this send from other + /// send requests. + /// An object that represents the asynchronous send request. + public sys.IAsyncResult BeginGetTextAsyncCheck(global::Dropbox.Api.Async.PollArg pollArg, sys.AsyncCallback callback, object state = null) + { + var task = this.GetTextAsyncCheckAsync(pollArg); + + return enc.Util.ToApm(task, callback, state); + } + + /// + /// Returns the status or result of specified get_text_async task. + /// + /// Id of the asynchronous job. This is the value of a + /// response returned from the method that launched the job. + /// The task that represents the asynchronous send operation. The TResult + /// parameter contains the response from the server. + /// Thrown if there is an error + /// processing the request; This will contain a . + public t.Task GetTextAsyncCheckAsync(string asyncJobId) + { + var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); + + return this.GetTextAsyncCheckAsync(pollArg); + } + + /// + /// Begins an asynchronous send to the get text async check route. + /// + /// Id of the asynchronous job. This is the value of a + /// response returned from the method that launched the job. + /// The method to be called when the asynchronous send is + /// completed. + /// A user provided object that distinguished this send + /// from other send requests. + /// An object that represents the asynchronous send request. + public sys.IAsyncResult BeginGetTextAsyncCheck(string asyncJobId, + sys.AsyncCallback callback, + object callbackState = null) + { + var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); + + return this.BeginGetTextAsyncCheck(pollArg, callback, callbackState); + } + + /// + /// Waits for the pending asynchronous send to the get text async check route to + /// complete + /// + /// The reference to the pending asynchronous send + /// request + /// The response to the send request + /// Thrown if there is an error + /// processing the request; This will contain a . + public GetTextAsyncCheckResult EndGetTextAsyncCheck(sys.IAsyncResult asyncResult) + { + var task = asyncResult as t.Task; + if (task == null) + { + throw new sys.InvalidOperationException(); + } + + return task.Result; + } + /// /// Asynchronous transcript generation for audio and video files. Supported audio /// formats: .aac, .aif, .aiff, .flac, .m4a, .m4r, .mp3, .oga, .ogg, .wav, .wma. diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/TextExtractionApiV2Error.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/TextExtractionApiV2Error.cs new file mode 100644 index 0000000000..fd360dd5bd --- /dev/null +++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Riviera/TextExtractionApiV2Error.cs @@ -0,0 +1,1159 @@ +// +// Auto-generated by StoneAPI, do not modify. +// + +namespace Dropbox.Api.Riviera +{ + using sys = System; + using col = System.Collections.Generic; + using re = System.Text.RegularExpressions; + + using enc = Dropbox.Api.Stone; + + /// + /// Reason a text extraction job failed. Returned in the `failed` variant of + /// `GetTextAsyncCheckResult`. This is a semantic error union: the HTTP status of the poll + /// request itself is unaffected (a poll that surfaces a failed job is still a normal + /// successful poll response). Callers should branch on the variant. + /// + public class TextExtractionApiV2Error + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new TextExtractionApiV2ErrorEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new TextExtractionApiV2ErrorDecoder(); + + /// + /// Initializes a new instance of the + /// class. + /// + public TextExtractionApiV2Error() + { + } + + /// + /// Gets a value indicating whether this instance is ServerError + /// + public bool IsServerError + { + get + { + return this is ServerError; + } + } + + /// + /// Gets this instance as a ServerError, or null. + /// + public ServerError AsServerError + { + get + { + return this as ServerError; + } + } + + /// + /// Gets a value indicating whether this instance is UserError + /// + public bool IsUserError + { + get + { + return this is UserError; + } + } + + /// + /// Gets this instance as a UserError, or null. + /// + public UserError AsUserError + { + get + { + return this as UserError; + } + } + + /// + /// Gets a value indicating whether this instance is + /// UnsupportedFormatError + /// + public bool IsUnsupportedFormatError + { + get + { + return this is UnsupportedFormatError; + } + } + + /// + /// Gets this instance as a UnsupportedFormatError, or null. + /// + public UnsupportedFormatError AsUnsupportedFormatError + { + get + { + return this as UnsupportedFormatError; + } + } + + /// + /// Gets a value indicating whether this instance is + /// LinkDownloadDisabledError + /// + public bool IsLinkDownloadDisabledError + { + get + { + return this is LinkDownloadDisabledError; + } + } + + /// + /// Gets this instance as a LinkDownloadDisabledError, or null. + /// + public LinkDownloadDisabledError AsLinkDownloadDisabledError + { + get + { + return this as LinkDownloadDisabledError; + } + } + + /// + /// Gets a value indicating whether this instance is + /// SharedLinkPasswordProtected + /// + public bool IsSharedLinkPasswordProtected + { + get + { + return this is SharedLinkPasswordProtected; + } + } + + /// + /// Gets this instance as a SharedLinkPasswordProtected, or null. + /// + public SharedLinkPasswordProtected AsSharedLinkPasswordProtected + { + get + { + return this as SharedLinkPasswordProtected; + } + } + + /// + /// Gets a value indicating whether this instance is LimitExceededError + /// + public bool IsLimitExceededError + { + get + { + return this is LimitExceededError; + } + } + + /// + /// Gets this instance as a LimitExceededError, or null. + /// + public LimitExceededError AsLimitExceededError + { + get + { + return this as LimitExceededError; + } + } + + /// + /// Gets a value indicating whether this instance is + /// ConversionFailureError + /// + public bool IsConversionFailureError + { + get + { + return this is ConversionFailureError; + } + } + + /// + /// Gets this instance as a ConversionFailureError, or null. + /// + public ConversionFailureError AsConversionFailureError + { + get + { + return this as ConversionFailureError; + } + } + + /// + /// Gets a value indicating whether this instance is NotFoundError + /// + public bool IsNotFoundError + { + get + { + return this is NotFoundError; + } + } + + /// + /// Gets this instance as a NotFoundError, or null. + /// + public NotFoundError AsNotFoundError + { + get + { + return this as NotFoundError; + } + } + + /// + /// Gets a value indicating whether this instance is IsAFolderError + /// + public bool IsIsAFolderError + { + get + { + return this is IsAFolderError; + } + } + + /// + /// Gets this instance as a IsAFolderError, or null. + /// + public IsAFolderError AsIsAFolderError + { + get + { + return this as IsAFolderError; + } + } + + /// + /// Gets a value indicating whether this instance is Other + /// + public bool IsOther + { + get + { + return this is Other; + } + } + + /// + /// Gets this instance as a Other, or null. + /// + public Other AsOther + { + get + { + return this as Other; + } + } + + #region Encoder class + + /// + /// Encoder for . + /// + private class TextExtractionApiV2ErrorEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + public override void EncodeFields(TextExtractionApiV2Error value, enc.IJsonWriter writer) + { + if (value is ServerError) + { + WriteProperty(".tag", "server_error", writer, enc.StringEncoder.Instance); + ServerError.Encoder.EncodeFields((ServerError)value, writer); + return; + } + if (value is UserError) + { + WriteProperty(".tag", "user_error", writer, enc.StringEncoder.Instance); + UserError.Encoder.EncodeFields((UserError)value, writer); + return; + } + if (value is UnsupportedFormatError) + { + WriteProperty(".tag", "unsupported_format_error", writer, enc.StringEncoder.Instance); + UnsupportedFormatError.Encoder.EncodeFields((UnsupportedFormatError)value, writer); + return; + } + if (value is LinkDownloadDisabledError) + { + WriteProperty(".tag", "link_download_disabled_error", writer, enc.StringEncoder.Instance); + LinkDownloadDisabledError.Encoder.EncodeFields((LinkDownloadDisabledError)value, writer); + return; + } + if (value is SharedLinkPasswordProtected) + { + WriteProperty(".tag", "shared_link_password_protected", writer, enc.StringEncoder.Instance); + SharedLinkPasswordProtected.Encoder.EncodeFields((SharedLinkPasswordProtected)value, writer); + return; + } + if (value is LimitExceededError) + { + WriteProperty(".tag", "limit_exceeded_error", writer, enc.StringEncoder.Instance); + LimitExceededError.Encoder.EncodeFields((LimitExceededError)value, writer); + return; + } + if (value is ConversionFailureError) + { + WriteProperty(".tag", "conversion_failure_error", writer, enc.StringEncoder.Instance); + ConversionFailureError.Encoder.EncodeFields((ConversionFailureError)value, writer); + return; + } + if (value is NotFoundError) + { + WriteProperty(".tag", "not_found_error", writer, enc.StringEncoder.Instance); + NotFoundError.Encoder.EncodeFields((NotFoundError)value, writer); + return; + } + if (value is IsAFolderError) + { + WriteProperty(".tag", "is_a_folder_error", writer, enc.StringEncoder.Instance); + IsAFolderError.Encoder.EncodeFields((IsAFolderError)value, writer); + return; + } + if (value is Other) + { + WriteProperty(".tag", "other", writer, enc.StringEncoder.Instance); + Other.Encoder.EncodeFields((Other)value, writer); + return; + } + throw new sys.InvalidOperationException(); + } + } + + #endregion + + #region Decoder class + + /// + /// Decoder for . + /// + private class TextExtractionApiV2ErrorDecoder : enc.UnionDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override TextExtractionApiV2Error Create() + { + return new TextExtractionApiV2Error(); + } + + /// + /// Decode based on given tag. + /// + /// The tag. + /// The json reader. + /// The decoded object. + protected override TextExtractionApiV2Error Decode(string tag, enc.IJsonReader reader) + { + switch (tag) + { + case "server_error": + return ServerError.Decoder.DecodeFields(reader); + case "user_error": + return UserError.Decoder.DecodeFields(reader); + case "unsupported_format_error": + return UnsupportedFormatError.Decoder.DecodeFields(reader); + case "link_download_disabled_error": + return LinkDownloadDisabledError.Decoder.DecodeFields(reader); + case "shared_link_password_protected": + return SharedLinkPasswordProtected.Decoder.DecodeFields(reader); + case "limit_exceeded_error": + return LimitExceededError.Decoder.DecodeFields(reader); + case "conversion_failure_error": + return ConversionFailureError.Decoder.DecodeFields(reader); + case "not_found_error": + return NotFoundError.Decoder.DecodeFields(reader); + case "is_a_folder_error": + return IsAFolderError.Decoder.DecodeFields(reader); + default: + return Other.Decoder.DecodeFields(reader); + } + } + } + + #endregion + + /// + /// An unexpected, typically transient, server-side failure. The string is a + /// human-readable message; retrying with backoff may succeed. + /// + public sealed class ServerError : TextExtractionApiV2Error + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new ServerErrorEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new ServerErrorDecoder(); + + /// + /// Initializes a new instance of the + /// class. + /// + /// The value + public ServerError(string value) + { + this.Value = value; + } + /// + /// Initializes a new instance of the + /// class. + /// + private ServerError() + { + } + + /// + /// Gets the value of this instance. + /// + public string Value { get; private set; } + + #region Encoder class + + /// + /// Encoder for . + /// + private class ServerErrorEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + public override void EncodeFields(ServerError value, enc.IJsonWriter writer) + { + WriteProperty("server_error", value.Value, writer, enc.StringEncoder.Instance); + } + } + + #endregion + + #region Decoder class + + /// + /// Decoder for . + /// + private class ServerErrorDecoder : enc.StructDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override ServerError Create() + { + return new ServerError(); + } + + /// + /// Set given field. + /// + /// The field value. + /// The field name. + /// The json reader. + protected override void SetField(ServerError value, string fieldName, enc.IJsonReader reader) + { + switch (fieldName) + { + case "server_error": + value.Value = enc.StringDecoder.Instance.Decode(reader); + break; + default: + reader.Skip(); + break; + } + } + } + + #endregion + } + + /// + /// The request could not be processed as supplied (a problem with the caller's + /// input). The string is a human-readable message; retrying the same request will not + /// help. + /// + public sealed class UserError : TextExtractionApiV2Error + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new UserErrorEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new UserErrorDecoder(); + + /// + /// Initializes a new instance of the class. + /// + /// The value + public UserError(string value) + { + this.Value = value; + } + /// + /// Initializes a new instance of the class. + /// + private UserError() + { + } + + /// + /// Gets the value of this instance. + /// + public string Value { get; private set; } + + #region Encoder class + + /// + /// Encoder for . + /// + private class UserErrorEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + public override void EncodeFields(UserError value, enc.IJsonWriter writer) + { + WriteProperty("user_error", value.Value, writer, enc.StringEncoder.Instance); + } + } + + #endregion + + #region Decoder class + + /// + /// Decoder for . + /// + private class UserErrorDecoder : enc.StructDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override UserError Create() + { + return new UserError(); + } + + /// + /// Set given field. + /// + /// The field value. + /// The field name. + /// The json reader. + protected override void SetField(UserError value, string fieldName, enc.IJsonReader reader) + { + switch (fieldName) + { + case "user_error": + value.Value = enc.StringDecoder.Instance.Decode(reader); + break; + default: + reader.Skip(); + break; + } + } + } + + #endregion + } + + /// + /// The unsupported format error object + /// + public sealed class UnsupportedFormatError : TextExtractionApiV2Error + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new UnsupportedFormatErrorEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new UnsupportedFormatErrorDecoder(); + + /// + /// Initializes a new instance of the + /// class. + /// + private UnsupportedFormatError() + { + } + + /// + /// A singleton instance of UnsupportedFormatError + /// + public static readonly UnsupportedFormatError Instance = new UnsupportedFormatError(); + + #region Encoder class + + /// + /// Encoder for . + /// + private class UnsupportedFormatErrorEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + public override void EncodeFields(UnsupportedFormatError value, enc.IJsonWriter writer) + { + } + } + + #endregion + + #region Decoder class + + /// + /// Decoder for . + /// + private class UnsupportedFormatErrorDecoder : enc.StructDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override UnsupportedFormatError Create() + { + return UnsupportedFormatError.Instance; + } + + } + + #endregion + } + + /// + /// The link download disabled error object + /// + public sealed class LinkDownloadDisabledError : TextExtractionApiV2Error + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new LinkDownloadDisabledErrorEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new LinkDownloadDisabledErrorDecoder(); + + /// + /// Initializes a new instance of the class. + /// + private LinkDownloadDisabledError() + { + } + + /// + /// A singleton instance of LinkDownloadDisabledError + /// + public static readonly LinkDownloadDisabledError Instance = new LinkDownloadDisabledError(); + + #region Encoder class + + /// + /// Encoder for . + /// + private class LinkDownloadDisabledErrorEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + public override void EncodeFields(LinkDownloadDisabledError value, enc.IJsonWriter writer) + { + } + } + + #endregion + + #region Decoder class + + /// + /// Decoder for . + /// + private class LinkDownloadDisabledErrorDecoder : enc.StructDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override LinkDownloadDisabledError Create() + { + return LinkDownloadDisabledError.Instance; + } + + } + + #endregion + } + + /// + /// The shared link password protected object + /// + public sealed class SharedLinkPasswordProtected : TextExtractionApiV2Error + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new SharedLinkPasswordProtectedEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new SharedLinkPasswordProtectedDecoder(); + + /// + /// Initializes a new instance of the class. + /// + private SharedLinkPasswordProtected() + { + } + + /// + /// A singleton instance of SharedLinkPasswordProtected + /// + public static readonly SharedLinkPasswordProtected Instance = new SharedLinkPasswordProtected(); + + #region Encoder class + + /// + /// Encoder for . + /// + private class SharedLinkPasswordProtectedEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + public override void EncodeFields(SharedLinkPasswordProtected value, enc.IJsonWriter writer) + { + } + } + + #endregion + + #region Decoder class + + /// + /// Decoder for . + /// + private class SharedLinkPasswordProtectedDecoder : enc.StructDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override SharedLinkPasswordProtected Create() + { + return SharedLinkPasswordProtected.Instance; + } + + } + + #endregion + } + + /// + /// The limit exceeded error object + /// + public sealed class LimitExceededError : TextExtractionApiV2Error + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new LimitExceededErrorEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new LimitExceededErrorDecoder(); + + /// + /// Initializes a new instance of the + /// class. + /// + private LimitExceededError() + { + } + + /// + /// A singleton instance of LimitExceededError + /// + public static readonly LimitExceededError Instance = new LimitExceededError(); + + #region Encoder class + + /// + /// Encoder for . + /// + private class LimitExceededErrorEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + public override void EncodeFields(LimitExceededError value, enc.IJsonWriter writer) + { + } + } + + #endregion + + #region Decoder class + + /// + /// Decoder for . + /// + private class LimitExceededErrorDecoder : enc.StructDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override LimitExceededError Create() + { + return LimitExceededError.Instance; + } + + } + + #endregion + } + + /// + /// The conversion failure error object + /// + public sealed class ConversionFailureError : TextExtractionApiV2Error + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new ConversionFailureErrorEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new ConversionFailureErrorDecoder(); + + /// + /// Initializes a new instance of the + /// class. + /// + private ConversionFailureError() + { + } + + /// + /// A singleton instance of ConversionFailureError + /// + public static readonly ConversionFailureError Instance = new ConversionFailureError(); + + #region Encoder class + + /// + /// Encoder for . + /// + private class ConversionFailureErrorEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + public override void EncodeFields(ConversionFailureError value, enc.IJsonWriter writer) + { + } + } + + #endregion + + #region Decoder class + + /// + /// Decoder for . + /// + private class ConversionFailureErrorDecoder : enc.StructDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override ConversionFailureError Create() + { + return ConversionFailureError.Instance; + } + + } + + #endregion + } + + /// + /// The referenced file does not exist or is not accessible. + /// + public sealed class NotFoundError : TextExtractionApiV2Error + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new NotFoundErrorEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new NotFoundErrorDecoder(); + + /// + /// Initializes a new instance of the + /// class. + /// + private NotFoundError() + { + } + + /// + /// A singleton instance of NotFoundError + /// + public static readonly NotFoundError Instance = new NotFoundError(); + + #region Encoder class + + /// + /// Encoder for . + /// + private class NotFoundErrorEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + public override void EncodeFields(NotFoundError value, enc.IJsonWriter writer) + { + } + } + + #endregion + + #region Decoder class + + /// + /// Decoder for . + /// + private class NotFoundErrorDecoder : enc.StructDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override NotFoundError Create() + { + return NotFoundError.Instance; + } + + } + + #endregion + } + + /// + /// The target is a folder, not a file. + /// + public sealed class IsAFolderError : TextExtractionApiV2Error + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new IsAFolderErrorEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new IsAFolderErrorDecoder(); + + /// + /// Initializes a new instance of the + /// class. + /// + private IsAFolderError() + { + } + + /// + /// A singleton instance of IsAFolderError + /// + public static readonly IsAFolderError Instance = new IsAFolderError(); + + #region Encoder class + + /// + /// Encoder for . + /// + private class IsAFolderErrorEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + public override void EncodeFields(IsAFolderError value, enc.IJsonWriter writer) + { + } + } + + #endregion + + #region Decoder class + + /// + /// Decoder for . + /// + private class IsAFolderErrorDecoder : enc.StructDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override IsAFolderError Create() + { + return IsAFolderError.Instance; + } + + } + + #endregion + } + + /// + /// The other object + /// + public sealed class Other : TextExtractionApiV2Error + { + #pragma warning disable 108 + + /// + /// The encoder instance. + /// + internal static enc.StructEncoder Encoder = new OtherEncoder(); + + /// + /// The decoder instance. + /// + internal static enc.StructDecoder Decoder = new OtherDecoder(); + + /// + /// Initializes a new instance of the class. + /// + private Other() + { + } + + /// + /// A singleton instance of Other + /// + public static readonly Other Instance = new Other(); + + #region Encoder class + + /// + /// Encoder for . + /// + private class OtherEncoder : enc.StructEncoder + { + /// + /// Encode fields of given value. + /// + /// The value. + /// The writer. + public override void EncodeFields(Other value, enc.IJsonWriter writer) + { + } + } + + #endregion + + #region Decoder class + + /// + /// Decoder for . + /// + private class OtherDecoder : enc.StructDecoder + { + /// + /// Create a new instance of type . + /// + /// The struct instance. + protected override Other Create() + { + return Other.Instance; + } + + } + + #endregion + } + } +} diff --git a/spec b/spec index b6bb8e88b6..c2df3ee5dc 160000 --- a/spec +++ b/spec @@ -1 +1 @@ -Subproject commit b6bb8e88b6cc5898dcc8eff66324908203d95eb4 +Subproject commit c2df3ee5dccc76a21bfa5b4139bff050cea53de7