Skip to content

Commit

Permalink
Automated Spec Update (#303)
Browse files Browse the repository at this point in the history
69f7bb2ea7702db5564f12549efb23956c5d6329

 Change Notes:

files Namespace
- Update examples

shared_links Namespace
- Update get_shared_link_metadata route to include app and user auth

team_folders Namespace
- Update team_folder/create, team_folder/rename, team_folder/list, team_folder/list/continue, team_folder/get_info, team_folder/activate, team_folder/archive, team_folder/archive/check, team_folder/permanently_delete, team_folder/update_sync_settings routes to include updated scopes

team_legal_holds Namespace
- Update legal_holds/create_policy, legal_holds/get_policy, legal_holds/list_policies, legal_holds/list_held_revisions, legal_holds/list_held_revisions_continue, legal_holds/update_policy, legal_holds/release_policy routes to include updated scopes
team_log_generated Namespace
- Update AdminAlertingAlertConfiguration to include text and excluded_file_extensions
- Update PlacementRestriction to include us_s3_only
- Update examples

Co-authored-by: DropboxBot <[email protected]>
Co-authored-by: Brent Bumann <[email protected]>
  • Loading branch information
3 people authored May 18, 2022
1 parent d194ef0 commit 30498a4
Show file tree
Hide file tree
Showing 6 changed files with 276 additions and 2 deletions.
7 changes: 7 additions & 0 deletions dropbox-sdk-dotnet/Dropbox.Api/Generated/DropboxAppClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace Dropbox.Api
using Dropbox.Api.Auth.Routes;
using Dropbox.Api.Check.Routes;
using Dropbox.Api.Files.Routes;
using Dropbox.Api.Sharing.Routes;

public sealed partial class DropboxAppClient
{
Expand All @@ -28,6 +29,11 @@ public sealed partial class DropboxAppClient
/// </summary>
public FilesAppRoutes Files { get; private set; }

/// <summary>
/// <para>Gets the Sharing routes.</para>
/// </summary>
public SharingAppRoutes Sharing { get; private set; }

/// <summary>
/// <para>Initializes the routes.</para>
/// </summary>
Expand All @@ -37,6 +43,7 @@ internal override void InitializeRoutes(ITransport transport)
this.Auth = new AuthAppRoutes(transport);
this.Check = new CheckAppRoutes(transport);
this.Files = new FilesAppRoutes(transport);
this.Sharing = new SharingAppRoutes(transport);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2056,6 +2056,7 @@ public enc.IDownloadResponse<FileMetadata> EndDownload(sys.IAsyncResult asyncRes
/// less than 20 GB in size and any single file within must be less than 4 GB in size.
/// The resulting zip must have fewer than 10,000 total file and folder entries,
/// including the top level folder. The input cannot be a single file.</para>
/// <para>Note: this endpoint does not support HTTP range requests.</para>
/// </summary>
/// <param name="downloadZipArg">The request parameters</param>
/// <returns>The task that represents the asynchronous send operation. The TResult
Expand Down Expand Up @@ -2089,6 +2090,7 @@ public sys.IAsyncResult BeginDownloadZip(DownloadZipArg downloadZipArg, sys.Asyn
/// less than 20 GB in size and any single file within must be less than 4 GB in size.
/// The resulting zip must have fewer than 10,000 total file and folder entries,
/// including the top level folder. The input cannot be a single file.</para>
/// <para>Note: this endpoint does not support HTTP range requests.</para>
/// </summary>
/// <param name="path">The path of the folder to download.</param>
/// <returns>The task that represents the asynchronous send operation. The TResult
Expand Down
136 changes: 136 additions & 0 deletions dropbox-sdk-dotnet/Dropbox.Api/Generated/Sharing/SharingAppRoutes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
// <auto-generated>
// Auto-generated by StoneAPI, do not modify.
// </auto-generated>

namespace Dropbox.Api.Sharing.Routes
{
using sys = System;
using io = System.IO;
using col = System.Collections.Generic;
using t = System.Threading.Tasks;
using enc = Dropbox.Api.Stone;

/// <summary>
/// <para>The routes for the <see cref="N:Dropbox.Api.Sharing"/> namespace</para>
/// </summary>
public class SharingAppRoutes
{
/// <summary>
/// <para>Initializes a new instance of the <see cref="SharingAppRoutes" />
/// class.</para>
/// </summary>
/// <param name="transport">The transport to use</param>
internal SharingAppRoutes(enc.ITransport transport)
{
this.Transport = transport;
}

/// <summary>
/// <para>Gets the transport used for these routes</para>
/// </summary>
internal enc.ITransport Transport { get; private set; }

/// <summary>
/// <para>Get the shared link's metadata.</para>
/// </summary>
/// <param name="getSharedLinkMetadataArg">The request parameters</param>
/// <returns>The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.</returns>
/// <exception cref="Dropbox.Api.ApiException{TError}">Thrown if there is an error
/// processing the request; This will contain a <see
/// cref="SharedLinkError"/>.</exception>
public t.Task<SharedLinkMetadata> GetSharedLinkMetadataAsync(GetSharedLinkMetadataArg getSharedLinkMetadataArg)
{
return this.Transport.SendRpcRequestAsync<GetSharedLinkMetadataArg, SharedLinkMetadata, SharedLinkError>(getSharedLinkMetadataArg, "api", "/sharing/get_shared_link_metadata", "app", global::Dropbox.Api.Sharing.GetSharedLinkMetadataArg.Encoder, global::Dropbox.Api.Sharing.SharedLinkMetadata.Decoder, global::Dropbox.Api.Sharing.SharedLinkError.Decoder);
}

/// <summary>
/// <para>Begins an asynchronous send to the get shared link metadata route.</para>
/// </summary>
/// <param name="getSharedLinkMetadataArg">The request parameters.</param>
/// <param name="callback">The method to be called when the asynchronous send is
/// completed.</param>
/// <param name="state">A user provided object that distinguished this send from other
/// send requests.</param>
/// <returns>An object that represents the asynchronous send request.</returns>
public sys.IAsyncResult BeginGetSharedLinkMetadata(GetSharedLinkMetadataArg getSharedLinkMetadataArg, sys.AsyncCallback callback, object state = null)
{
var task = this.GetSharedLinkMetadataAsync(getSharedLinkMetadataArg);

return enc.Util.ToApm(task, callback, state);
}

/// <summary>
/// <para>Get the shared link's metadata.</para>
/// </summary>
/// <param name="url">URL of the shared link.</param>
/// <param name="path">If the shared link is to a folder, this parameter can be used to
/// retrieve the metadata for a specific file or sub-folder in this folder. A relative
/// path should be used.</param>
/// <param name="linkPassword">If the shared link has a password, this parameter can be
/// used.</param>
/// <returns>The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.</returns>
/// <exception cref="Dropbox.Api.ApiException{TError}">Thrown if there is an error
/// processing the request; This will contain a <see
/// cref="SharedLinkError"/>.</exception>
public t.Task<SharedLinkMetadata> GetSharedLinkMetadataAsync(string url,
string path = null,
string linkPassword = null)
{
var getSharedLinkMetadataArg = new GetSharedLinkMetadataArg(url,
path,
linkPassword);

return this.GetSharedLinkMetadataAsync(getSharedLinkMetadataArg);
}

/// <summary>
/// <para>Begins an asynchronous send to the get shared link metadata route.</para>
/// </summary>
/// <param name="url">URL of the shared link.</param>
/// <param name="path">If the shared link is to a folder, this parameter can be used to
/// retrieve the metadata for a specific file or sub-folder in this folder. A relative
/// path should be used.</param>
/// <param name="linkPassword">If the shared link has a password, this parameter can be
/// used.</param>
/// <param name="callback">The method to be called when the asynchronous send is
/// completed.</param>
/// <param name="callbackState">A user provided object that distinguished this send
/// from other send requests.</param>
/// <returns>An object that represents the asynchronous send request.</returns>
public sys.IAsyncResult BeginGetSharedLinkMetadata(string url,
string path = null,
string linkPassword = null,
sys.AsyncCallback callback = null,
object callbackState = null)
{
var getSharedLinkMetadataArg = new GetSharedLinkMetadataArg(url,
path,
linkPassword);

return this.BeginGetSharedLinkMetadata(getSharedLinkMetadataArg, callback, callbackState);
}

/// <summary>
/// <para>Waits for the pending asynchronous send to the get shared link metadata route
/// to complete</para>
/// </summary>
/// <param name="asyncResult">The reference to the pending asynchronous send
/// request</param>
/// <returns>The response to the send request</returns>
/// <exception cref="Dropbox.Api.ApiException{TError}">Thrown if there is an error
/// processing the request; This will contain a <see
/// cref="SharedLinkError"/>.</exception>
public SharedLinkMetadata EndGetSharedLinkMetadata(sys.IAsyncResult asyncResult)
{
var task = asyncResult as t.Task<SharedLinkMetadata>;
if (task == null)
{
throw new sys.InvalidOperationException();
}

return task.Result;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,19 @@ public class AdminAlertingAlertConfiguration
/// <param name="alertState">Alert state.</param>
/// <param name="sensitivityLevel">Sensitivity level.</param>
/// <param name="recipientsSettings">Recipient settings.</param>
/// <param name="text">Text.</param>
/// <param name="excludedFileExtensions">Excluded file extensions.</param>
public AdminAlertingAlertConfiguration(AdminAlertingAlertStatePolicy alertState = null,
AdminAlertingAlertSensitivity sensitivityLevel = null,
RecipientsConfiguration recipientsSettings = null)
RecipientsConfiguration recipientsSettings = null,
string text = null,
string excludedFileExtensions = null)
{
this.AlertState = alertState;
this.SensitivityLevel = sensitivityLevel;
this.RecipientsSettings = recipientsSettings;
this.Text = text;
this.ExcludedFileExtensions = excludedFileExtensions;
}

/// <summary>
Expand Down Expand Up @@ -70,6 +76,16 @@ public AdminAlertingAlertConfiguration()
/// </summary>
public RecipientsConfiguration RecipientsSettings { get; protected set; }

/// <summary>
/// <para>Text.</para>
/// </summary>
public string Text { get; protected set; }

/// <summary>
/// <para>Excluded file extensions.</para>
/// </summary>
public string ExcludedFileExtensions { get; protected set; }

#region Encoder class

/// <summary>
Expand All @@ -96,6 +112,14 @@ public override void EncodeFields(AdminAlertingAlertConfiguration value, enc.IJs
{
WriteProperty("recipients_settings", value.RecipientsSettings, writer, global::Dropbox.Api.TeamLog.RecipientsConfiguration.Encoder);
}
if (value.Text != null)
{
WriteProperty("text", value.Text, writer, enc.StringEncoder.Instance);
}
if (value.ExcludedFileExtensions != null)
{
WriteProperty("excluded_file_extensions", value.ExcludedFileExtensions, writer, enc.StringEncoder.Instance);
}
}
}

Expand Down Expand Up @@ -138,6 +162,12 @@ protected override void SetField(AdminAlertingAlertConfiguration value, string f
case "recipients_settings":
value.RecipientsSettings = global::Dropbox.Api.TeamLog.RecipientsConfiguration.Decoder.Decode(reader);
break;
case "text":
value.Text = enc.StringDecoder.Instance.Decode(reader);
break;
case "excluded_file_extensions":
value.ExcludedFileExtensions = enc.StringDecoder.Instance.Decode(reader);
break;
default:
reader.Skip();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,28 @@ public UkOnly AsUkOnly
}
}

/// <summary>
/// <para>Gets a value indicating whether this instance is UsS3Only</para>
/// </summary>
public bool IsUsS3Only
{
get
{
return this is UsS3Only;
}
}

/// <summary>
/// <para>Gets this instance as a UsS3Only, or <c>null</c>.</para>
/// </summary>
public UsS3Only AsUsS3Only
{
get
{
return this as UsS3Only;
}
}

/// <summary>
/// <para>Gets a value indicating whether this instance is Other</para>
/// </summary>
Expand Down Expand Up @@ -211,6 +233,12 @@ public override void EncodeFields(PlacementRestriction value, enc.IJsonWriter wr
UkOnly.Encoder.EncodeFields((UkOnly)value, writer);
return;
}
if (value is UsS3Only)
{
WriteProperty(".tag", "us_s3_only", writer, enc.StringEncoder.Instance);
UsS3Only.Encoder.EncodeFields((UsS3Only)value, writer);
return;
}
if (value is Other)
{
WriteProperty(".tag", "other", writer, enc.StringEncoder.Instance);
Expand Down Expand Up @@ -259,6 +287,8 @@ protected override PlacementRestriction Decode(string tag, enc.IJsonReader reade
return None.Decoder.DecodeFields(reader);
case "uk_only":
return UkOnly.Decoder.DecodeFields(reader);
case "us_s3_only":
return UsS3Only.Decoder.DecodeFields(reader);
default:
return Other.Decoder.DecodeFields(reader);
}
Expand Down Expand Up @@ -613,6 +643,75 @@ protected override UkOnly Create()
#endregion
}

/// <summary>
/// <para>The us s3 only object</para>
/// </summary>
public sealed class UsS3Only : PlacementRestriction
{
#pragma warning disable 108

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

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

/// <summary>
/// <para>Initializes a new instance of the <see cref="UsS3Only" /> class.</para>
/// </summary>
private UsS3Only()
{
}

/// <summary>
/// <para>A singleton instance of UsS3Only</para>
/// </summary>
public static readonly UsS3Only Instance = new UsS3Only();

#region Encoder class

/// <summary>
/// <para>Encoder for <see cref="UsS3Only" />.</para>
/// </summary>
private class UsS3OnlyEncoder : enc.StructEncoder<UsS3Only>
{
/// <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(UsS3Only value, enc.IJsonWriter writer)
{
}
}

#endregion

#region Decoder class

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

}

#endregion
}

/// <summary>
/// <para>The other object</para>
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion spec

0 comments on commit 30498a4

Please sign in to comment.