Skip to content

Commit 0246b7a

Browse files
authored
Automated Spec Update (#246)
9923a5075753fa7521c9a180407420b5d893e163 Change Notes: shared_content_links Namespace: - Update Comments shared_links Namespace: - Update SharedLinkSettings struct to include require_password - Update Comments team_log_generated Namespace: - Add ChangeLinkExpirationPolicy, DefaultLinkExpirationDaysPolicy, EnforceLinkPasswordPolicy unions - Update LabelType union to include test_only - Add ApplyNamingConventionDetails, UserTagsAddedDetails, UserTagsRemovedDetails, SharingChangeLinkAllowChangeExpirationPolicyDetails, SharingChangeLinkDefaultExpirationPolicyDetails, SharingChangeLinkEnforcePasswordPolicyDetails, ApplyNamingConventionType, UserTagsAddedType, UserTagsRemovedType, SharingChangeLinkAllowChangeExpirationPolicyType, SharingChangeLinkDefaultExpirationPolicyType and SharingChangeLinkEnforcePasswordPolicyType structs - Update EventDetails union to include apply_naming_convention_details, user_tags_added_details, user_tags_removed_details, sharing_change_link_allow_change_expiration_policy_details, sharing_change_link_default_expiration_policy_details and sharing_change_link_enforce_password_policy_details - Update EventType union to include apply_naming_convention, user_tags_added, user_tags_removed, sharing_change_link_allow_change_expiration_policy, sharing_change_link_default_expiration_policy and sharing_change_link_enforce_password_policy - Update EventTypeArg union to include apply_naming_convention, user_tags_added, user_tags_removed, sharing_change_link_allow_change_expiration_policy, sharing_change_link_default_expiration_policy and sharing_change_link_enforce_password_policy - Update Examples Co-authored-by: DropboxBot <DropboxBot@users.noreply.github.com>
1 parent 052fe1b commit 0246b7a

22 files changed

+5469
-20
lines changed

dropbox-sdk-dotnet/Dropbox.Api/Generated/Sharing/LinkAudience.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,8 @@ protected override NoOne Create()
477477
}
478478

479479
/// <summary>
480-
/// <para>A link-specific password is required to access the link. Login is not
481-
/// required.</para>
480+
/// <para>Use `require_password` instead. A link-specific password is required to
481+
/// access the link. Login is not required.</para>
482482
/// </summary>
483483
public sealed class Password : LinkAudience
484484
{

dropbox-sdk-dotnet/Dropbox.Api/Generated/Sharing/SharedLinkSettings.cs

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ public class SharedLinkSettings
3232
/// <para>Initializes a new instance of the <see cref="SharedLinkSettings" />
3333
/// class.</para>
3434
/// </summary>
35-
/// <param name="requestedVisibility">The requested access for this shared
36-
/// link.</param>
37-
/// <param name="linkPassword">If <paramref name="requestedVisibility" /> is <see
38-
/// cref="Dropbox.Api.Sharing.RequestedVisibility.Password" /> this is needed to
39-
/// specify the password to access the link.</param>
35+
/// <param name="requirePassword">Boolean flag to enable or disable password
36+
/// protection.</param>
37+
/// <param name="linkPassword">If <paramref name="requirePassword" /> is true, this is
38+
/// needed to specify the password to access the link.</param>
4039
/// <param name="expires">Expiration time of the shared link. By default the link won't
4140
/// expire.</param>
4241
/// <param name="audience">The new audience who can benefit from the access level
@@ -46,17 +45,21 @@ public class SharedLinkSettings
4645
/// field of `LinkPermissions.</param>
4746
/// <param name="access">Requested access level you want the audience to gain from this
4847
/// link. Note, modifying access level for an existing link is not supported.</param>
49-
public SharedLinkSettings(RequestedVisibility requestedVisibility = null,
48+
/// <param name="requestedVisibility">Use <paramref name="audience" /> instead. The
49+
/// requested access for this shared link.</param>
50+
public SharedLinkSettings(bool? requirePassword = null,
5051
string linkPassword = null,
5152
sys.DateTime? expires = null,
5253
LinkAudience audience = null,
53-
RequestedLinkAccessLevel access = null)
54+
RequestedLinkAccessLevel access = null,
55+
RequestedVisibility requestedVisibility = null)
5456
{
55-
this.RequestedVisibility = requestedVisibility;
57+
this.RequirePassword = requirePassword;
5658
this.LinkPassword = linkPassword;
5759
this.Expires = expires;
5860
this.Audience = audience;
5961
this.Access = access;
62+
this.RequestedVisibility = requestedVisibility;
6063
}
6164

6265
/// <summary>
@@ -71,14 +74,13 @@ public SharedLinkSettings()
7174
}
7275

7376
/// <summary>
74-
/// <para>The requested access for this shared link.</para>
77+
/// <para>Boolean flag to enable or disable password protection.</para>
7578
/// </summary>
76-
public RequestedVisibility RequestedVisibility { get; protected set; }
79+
public bool? RequirePassword { get; protected set; }
7780

7881
/// <summary>
79-
/// <para>If <see cref="RequestedVisibility" /> is <see
80-
/// cref="Dropbox.Api.Sharing.RequestedVisibility.Password" /> this is needed to
81-
/// specify the password to access the link.</para>
82+
/// <para>If <see cref="RequirePassword" /> is true, this is needed to specify the
83+
/// password to access the link.</para>
8284
/// </summary>
8385
public string LinkPassword { get; protected set; }
8486

@@ -102,6 +104,12 @@ public SharedLinkSettings()
102104
/// </summary>
103105
public RequestedLinkAccessLevel Access { get; protected set; }
104106

107+
/// <summary>
108+
/// <para>Use <see cref="Audience" /> instead. The requested access for this shared
109+
/// link.</para>
110+
/// </summary>
111+
public RequestedVisibility RequestedVisibility { get; protected set; }
112+
105113
#region Encoder class
106114

107115
/// <summary>
@@ -116,9 +124,9 @@ private class SharedLinkSettingsEncoder : enc.StructEncoder<SharedLinkSettings>
116124
/// <param name="writer">The writer.</param>
117125
public override void EncodeFields(SharedLinkSettings value, enc.IJsonWriter writer)
118126
{
119-
if (value.RequestedVisibility != null)
127+
if (value.RequirePassword != null)
120128
{
121-
WriteProperty("requested_visibility", value.RequestedVisibility, writer, global::Dropbox.Api.Sharing.RequestedVisibility.Encoder);
129+
WriteProperty("require_password", value.RequirePassword.Value, writer, enc.BooleanEncoder.Instance);
122130
}
123131
if (value.LinkPassword != null)
124132
{
@@ -136,6 +144,10 @@ public override void EncodeFields(SharedLinkSettings value, enc.IJsonWriter writ
136144
{
137145
WriteProperty("access", value.Access, writer, global::Dropbox.Api.Sharing.RequestedLinkAccessLevel.Encoder);
138146
}
147+
if (value.RequestedVisibility != null)
148+
{
149+
WriteProperty("requested_visibility", value.RequestedVisibility, writer, global::Dropbox.Api.Sharing.RequestedVisibility.Encoder);
150+
}
139151
}
140152
}
141153

@@ -168,8 +180,8 @@ protected override void SetField(SharedLinkSettings value, string fieldName, enc
168180
{
169181
switch (fieldName)
170182
{
171-
case "requested_visibility":
172-
value.RequestedVisibility = global::Dropbox.Api.Sharing.RequestedVisibility.Decoder.Decode(reader);
183+
case "require_password":
184+
value.RequirePassword = enc.BooleanDecoder.Instance.Decode(reader);
173185
break;
174186
case "link_password":
175187
value.LinkPassword = enc.StringDecoder.Instance.Decode(reader);
@@ -183,6 +195,9 @@ protected override void SetField(SharedLinkSettings value, string fieldName, enc
183195
case "access":
184196
value.Access = global::Dropbox.Api.Sharing.RequestedLinkAccessLevel.Decoder.Decode(reader);
185197
break;
198+
case "requested_visibility":
199+
value.RequestedVisibility = global::Dropbox.Api.Sharing.RequestedVisibility.Decoder.Decode(reader);
200+
break;
186201
default:
187202
reader.Skip();
188203
break;
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
// <auto-generated>
2+
// Auto-generated by StoneAPI, do not modify.
3+
// </auto-generated>
4+
5+
namespace Dropbox.Api.TeamLog
6+
{
7+
using sys = System;
8+
using col = System.Collections.Generic;
9+
using re = System.Text.RegularExpressions;
10+
11+
using enc = Dropbox.Api.Stone;
12+
13+
/// <summary>
14+
/// <para>Applied a Naming Convention rule.</para>
15+
/// </summary>
16+
public class ApplyNamingConventionDetails
17+
{
18+
#pragma warning disable 108
19+
20+
/// <summary>
21+
/// <para>The encoder instance.</para>
22+
/// </summary>
23+
internal static enc.StructEncoder<ApplyNamingConventionDetails> Encoder = new ApplyNamingConventionDetailsEncoder();
24+
25+
/// <summary>
26+
/// <para>The decoder instance.</para>
27+
/// </summary>
28+
internal static enc.StructDecoder<ApplyNamingConventionDetails> Decoder = new ApplyNamingConventionDetailsDecoder();
29+
30+
/// <summary>
31+
/// <para>Initializes a new instance of the <see cref="ApplyNamingConventionDetails" />
32+
/// class.</para>
33+
/// </summary>
34+
public ApplyNamingConventionDetails()
35+
{
36+
}
37+
38+
#region Encoder class
39+
40+
/// <summary>
41+
/// <para>Encoder for <see cref="ApplyNamingConventionDetails" />.</para>
42+
/// </summary>
43+
private class ApplyNamingConventionDetailsEncoder : enc.StructEncoder<ApplyNamingConventionDetails>
44+
{
45+
/// <summary>
46+
/// <para>Encode fields of given value.</para>
47+
/// </summary>
48+
/// <param name="value">The value.</param>
49+
/// <param name="writer">The writer.</param>
50+
public override void EncodeFields(ApplyNamingConventionDetails value, enc.IJsonWriter writer)
51+
{
52+
}
53+
}
54+
55+
#endregion
56+
57+
58+
#region Decoder class
59+
60+
/// <summary>
61+
/// <para>Decoder for <see cref="ApplyNamingConventionDetails" />.</para>
62+
/// </summary>
63+
private class ApplyNamingConventionDetailsDecoder : enc.StructDecoder<ApplyNamingConventionDetails>
64+
{
65+
/// <summary>
66+
/// <para>Create a new instance of type <see cref="ApplyNamingConventionDetails"
67+
/// />.</para>
68+
/// </summary>
69+
/// <returns>The struct instance.</returns>
70+
protected override ApplyNamingConventionDetails Create()
71+
{
72+
return new ApplyNamingConventionDetails();
73+
}
74+
75+
/// <summary>
76+
/// <para>Set given field.</para>
77+
/// </summary>
78+
/// <param name="value">The field value.</param>
79+
/// <param name="fieldName">The field name.</param>
80+
/// <param name="reader">The json reader.</param>
81+
protected override void SetField(ApplyNamingConventionDetails value, string fieldName, enc.IJsonReader reader)
82+
{
83+
switch (fieldName)
84+
{
85+
default:
86+
reader.Skip();
87+
break;
88+
}
89+
}
90+
}
91+
92+
#endregion
93+
}
94+
}
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
// <auto-generated>
2+
// Auto-generated by StoneAPI, do not modify.
3+
// </auto-generated>
4+
5+
namespace Dropbox.Api.TeamLog
6+
{
7+
using sys = System;
8+
using col = System.Collections.Generic;
9+
using re = System.Text.RegularExpressions;
10+
11+
using enc = Dropbox.Api.Stone;
12+
13+
/// <summary>
14+
/// <para>The apply naming convention type object</para>
15+
/// </summary>
16+
public class ApplyNamingConventionType
17+
{
18+
#pragma warning disable 108
19+
20+
/// <summary>
21+
/// <para>The encoder instance.</para>
22+
/// </summary>
23+
internal static enc.StructEncoder<ApplyNamingConventionType> Encoder = new ApplyNamingConventionTypeEncoder();
24+
25+
/// <summary>
26+
/// <para>The decoder instance.</para>
27+
/// </summary>
28+
internal static enc.StructDecoder<ApplyNamingConventionType> Decoder = new ApplyNamingConventionTypeDecoder();
29+
30+
/// <summary>
31+
/// <para>Initializes a new instance of the <see cref="ApplyNamingConventionType" />
32+
/// class.</para>
33+
/// </summary>
34+
/// <param name="description">The description</param>
35+
public ApplyNamingConventionType(string description)
36+
{
37+
if (description == null)
38+
{
39+
throw new sys.ArgumentNullException("description");
40+
}
41+
42+
this.Description = description;
43+
}
44+
45+
/// <summary>
46+
/// <para>Initializes a new instance of the <see cref="ApplyNamingConventionType" />
47+
/// class.</para>
48+
/// </summary>
49+
/// <remarks>This is to construct an instance of the object when
50+
/// deserializing.</remarks>
51+
[sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)]
52+
public ApplyNamingConventionType()
53+
{
54+
}
55+
56+
/// <summary>
57+
/// <para>Gets the description of the apply naming convention type</para>
58+
/// </summary>
59+
public string Description { get; protected set; }
60+
61+
#region Encoder class
62+
63+
/// <summary>
64+
/// <para>Encoder for <see cref="ApplyNamingConventionType" />.</para>
65+
/// </summary>
66+
private class ApplyNamingConventionTypeEncoder : enc.StructEncoder<ApplyNamingConventionType>
67+
{
68+
/// <summary>
69+
/// <para>Encode fields of given value.</para>
70+
/// </summary>
71+
/// <param name="value">The value.</param>
72+
/// <param name="writer">The writer.</param>
73+
public override void EncodeFields(ApplyNamingConventionType value, enc.IJsonWriter writer)
74+
{
75+
WriteProperty("description", value.Description, writer, enc.StringEncoder.Instance);
76+
}
77+
}
78+
79+
#endregion
80+
81+
82+
#region Decoder class
83+
84+
/// <summary>
85+
/// <para>Decoder for <see cref="ApplyNamingConventionType" />.</para>
86+
/// </summary>
87+
private class ApplyNamingConventionTypeDecoder : enc.StructDecoder<ApplyNamingConventionType>
88+
{
89+
/// <summary>
90+
/// <para>Create a new instance of type <see cref="ApplyNamingConventionType"
91+
/// />.</para>
92+
/// </summary>
93+
/// <returns>The struct instance.</returns>
94+
protected override ApplyNamingConventionType Create()
95+
{
96+
return new ApplyNamingConventionType();
97+
}
98+
99+
/// <summary>
100+
/// <para>Set given field.</para>
101+
/// </summary>
102+
/// <param name="value">The field value.</param>
103+
/// <param name="fieldName">The field name.</param>
104+
/// <param name="reader">The json reader.</param>
105+
protected override void SetField(ApplyNamingConventionType value, string fieldName, enc.IJsonReader reader)
106+
{
107+
switch (fieldName)
108+
{
109+
case "description":
110+
value.Description = enc.StringDecoder.Instance.Decode(reader);
111+
break;
112+
default:
113+
reader.Skip();
114+
break;
115+
}
116+
}
117+
}
118+
119+
#endregion
120+
}
121+
}

0 commit comments

Comments
 (0)