Skip to content

Commit

Permalink
Update project URL in examples websites to avoid potential conflict.
Browse files Browse the repository at this point in the history
  • Loading branch information
qimingyuan committed Oct 19, 2016
1 parent 987d539 commit 54d9036
Show file tree
Hide file tree
Showing 52 changed files with 5,893 additions and 128 deletions.
109 changes: 109 additions & 0 deletions Dropbox.Api/Auth/AuthError.cs
Expand Up @@ -100,6 +100,28 @@ public InvalidSelectAdmin AsInvalidSelectAdmin
}
}

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

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

/// <summary>
/// <para>Gets a value indicating whether this instance is Other</para>
/// </summary>
Expand Down Expand Up @@ -154,6 +176,12 @@ public override void EncodeFields(AuthError value, enc.IJsonWriter writer)
InvalidSelectAdmin.Encoder.EncodeFields((InvalidSelectAdmin)value, writer);
return;
}
if (value is UserSuspended)
{
WriteProperty(".tag", "user_suspended", writer, enc.StringEncoder.Instance);
UserSuspended.Encoder.EncodeFields((UserSuspended)value, writer);
return;
}
if (value is Other)
{
WriteProperty(".tag", "other", writer, enc.StringEncoder.Instance);
Expand Down Expand Up @@ -198,6 +226,8 @@ protected override AuthError Decode(string tag, enc.IJsonReader reader)
return InvalidSelectUser.Decoder.DecodeFields(reader);
case "invalid_select_admin":
return InvalidSelectAdmin.Decoder.DecodeFields(reader);
case "user_suspended":
return UserSuspended.Decoder.DecodeFields(reader);
default:
return Other.Decoder.DecodeFields(reader);
}
Expand Down Expand Up @@ -448,6 +478,85 @@ public override InvalidSelectAdmin DecodeFields(enc.IJsonReader reader)
#endregion
}

/// <summary>
/// <para>The user has been suspended.</para>
/// </summary>
public sealed class UserSuspended : AuthError
{
#pragma warning disable 108

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

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

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

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

#region Encoder class

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

#endregion

#region Decoder class

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

/// <summary>
/// <para>Decode fields without ensuring start and end object.</para>
/// </summary>
/// <param name="reader">The json reader.</param>
/// <returns>The decoded object.</returns>
public override UserSuspended DecodeFields(enc.IJsonReader reader)
{
return UserSuspended.Instance;
}
}

#endregion
}

/// <summary>
/// <para>The other object</para>
/// </summary>
Expand Down
13 changes: 13 additions & 0 deletions Dropbox.Api/Dropbox.Api.Portable.csproj
Expand Up @@ -88,7 +88,13 @@
<Compile Include="Files\CreateFolderArg.cs" />
<Compile Include="Files\CreateFolderError.cs" />
<Compile Include="Files\DeleteArg.cs" />
<Compile Include="Files\DeleteBatchArg.cs" />
<Compile Include="Files\DeleteBatchError.cs" />
<Compile Include="Files\DeleteBatchJobStatus.cs" />
<Compile Include="Files\DeleteBatchResult.cs" />
<Compile Include="Files\DeleteBatchResultEntry.cs" />
<Compile Include="Files\DeleteError.cs" />
<Compile Include="Files\DeleteResult.cs" />
<Compile Include="Files\DeletedMetadata.cs" />
<Compile Include="Files\Dimensions.cs" />
<Compile Include="Files\DownloadArg.cs" />
Expand Down Expand Up @@ -125,14 +131,21 @@
<Compile Include="Files\MediaInfo.cs" />
<Compile Include="Files\MediaMetadata.cs" />
<Compile Include="Files\Metadata.cs" />
<Compile Include="Files\PathRootError.cs" />
<Compile Include="Files\PhotoMetadata.cs" />
<Compile Include="Files\PreviewArg.cs" />
<Compile Include="Files\PreviewError.cs" />
<Compile Include="Files\PropertiesError.cs" />
<Compile Include="Files\PropertyGroupUpdate.cs" />
<Compile Include="Files\PropertyGroupWithPath.cs" />
<Compile Include="Files\RelocationArg.cs" />
<Compile Include="Files\RelocationBatchArg.cs" />
<Compile Include="Files\RelocationBatchError.cs" />
<Compile Include="Files\RelocationBatchJobStatus.cs" />
<Compile Include="Files\RelocationBatchResult.cs" />
<Compile Include="Files\RelocationError.cs" />
<Compile Include="Files\RelocationPath.cs" />
<Compile Include="Files\RelocationResult.cs" />
<Compile Include="Files\RemovePropertiesArg.cs" />
<Compile Include="Files\RemovePropertiesError.cs" />
<Compile Include="Files\RestoreArg.cs" />
Expand Down
13 changes: 13 additions & 0 deletions Dropbox.Api/Dropbox.Api.Portable40.csproj
Expand Up @@ -112,7 +112,13 @@
<Compile Include="Files\CreateFolderArg.cs" />
<Compile Include="Files\CreateFolderError.cs" />
<Compile Include="Files\DeleteArg.cs" />
<Compile Include="Files\DeleteBatchArg.cs" />
<Compile Include="Files\DeleteBatchError.cs" />
<Compile Include="Files\DeleteBatchJobStatus.cs" />
<Compile Include="Files\DeleteBatchResult.cs" />
<Compile Include="Files\DeleteBatchResultEntry.cs" />
<Compile Include="Files\DeleteError.cs" />
<Compile Include="Files\DeleteResult.cs" />
<Compile Include="Files\DeletedMetadata.cs" />
<Compile Include="Files\Dimensions.cs" />
<Compile Include="Files\DownloadArg.cs" />
Expand Down Expand Up @@ -149,14 +155,21 @@
<Compile Include="Files\MediaInfo.cs" />
<Compile Include="Files\MediaMetadata.cs" />
<Compile Include="Files\Metadata.cs" />
<Compile Include="Files\PathRootError.cs" />
<Compile Include="Files\PhotoMetadata.cs" />
<Compile Include="Files\PreviewArg.cs" />
<Compile Include="Files\PreviewError.cs" />
<Compile Include="Files\PropertiesError.cs" />
<Compile Include="Files\PropertyGroupUpdate.cs" />
<Compile Include="Files\PropertyGroupWithPath.cs" />
<Compile Include="Files\RelocationArg.cs" />
<Compile Include="Files\RelocationBatchArg.cs" />
<Compile Include="Files\RelocationBatchError.cs" />
<Compile Include="Files\RelocationBatchJobStatus.cs" />
<Compile Include="Files\RelocationBatchResult.cs" />
<Compile Include="Files\RelocationError.cs" />
<Compile Include="Files\RelocationPath.cs" />
<Compile Include="Files\RelocationResult.cs" />
<Compile Include="Files\RemovePropertiesArg.cs" />
<Compile Include="Files\RemovePropertiesError.cs" />
<Compile Include="Files\RestoreArg.cs" />
Expand Down
13 changes: 13 additions & 0 deletions Dropbox.Api/Dropbox.Api.csproj
Expand Up @@ -93,7 +93,13 @@
<Compile Include="Files\CreateFolderArg.cs" />
<Compile Include="Files\CreateFolderError.cs" />
<Compile Include="Files\DeleteArg.cs" />
<Compile Include="Files\DeleteBatchArg.cs" />
<Compile Include="Files\DeleteBatchError.cs" />
<Compile Include="Files\DeleteBatchJobStatus.cs" />
<Compile Include="Files\DeleteBatchResult.cs" />
<Compile Include="Files\DeleteBatchResultEntry.cs" />
<Compile Include="Files\DeleteError.cs" />
<Compile Include="Files\DeleteResult.cs" />
<Compile Include="Files\DeletedMetadata.cs" />
<Compile Include="Files\Dimensions.cs" />
<Compile Include="Files\DownloadArg.cs" />
Expand Down Expand Up @@ -130,14 +136,21 @@
<Compile Include="Files\MediaInfo.cs" />
<Compile Include="Files\MediaMetadata.cs" />
<Compile Include="Files\Metadata.cs" />
<Compile Include="Files\PathRootError.cs" />
<Compile Include="Files\PhotoMetadata.cs" />
<Compile Include="Files\PreviewArg.cs" />
<Compile Include="Files\PreviewError.cs" />
<Compile Include="Files\PropertiesError.cs" />
<Compile Include="Files\PropertyGroupUpdate.cs" />
<Compile Include="Files\PropertyGroupWithPath.cs" />
<Compile Include="Files\RelocationArg.cs" />
<Compile Include="Files\RelocationBatchArg.cs" />
<Compile Include="Files\RelocationBatchError.cs" />
<Compile Include="Files\RelocationBatchJobStatus.cs" />
<Compile Include="Files\RelocationBatchResult.cs" />
<Compile Include="Files\RelocationError.cs" />
<Compile Include="Files\RelocationPath.cs" />
<Compile Include="Files\RelocationResult.cs" />
<Compile Include="Files\RemovePropertiesArg.cs" />
<Compile Include="Files\RemovePropertiesError.cs" />
<Compile Include="Files\RestoreArg.cs" />
Expand Down
7 changes: 4 additions & 3 deletions Dropbox.Api/Files/AlphaGetMetadataArg.cs
Expand Up @@ -42,7 +42,7 @@ public class AlphaGetMetadataArg : GetMetadataArg
/// <param name="includeHasExplicitSharedMembers">If true, the results will include a
/// flag for each file indicating whether or not that file has any explicit
/// members.</param>
/// <param name="includePropertyTemplates">If true, <see
/// <param name="includePropertyTemplates">If set to a valid list of template IDs, <see
/// cref="Dropbox.Api.Files.FileMetadata.PropertyGroups" /> is set for files with
/// custom properties.</param>
public AlphaGetMetadataArg(string path,
Expand All @@ -68,8 +68,9 @@ public AlphaGetMetadataArg()
}

/// <summary>
/// <para>If true, <see cref="Dropbox.Api.Files.FileMetadata.PropertyGroups" /> is set
/// for files with custom properties.</para>
/// <para>If set to a valid list of template IDs, <see
/// cref="Dropbox.Api.Files.FileMetadata.PropertyGroups" /> is set for files with
/// custom properties.</para>
/// </summary>
public col.IList<string> IncludePropertyTemplates { get; protected set; }

Expand Down
17 changes: 16 additions & 1 deletion Dropbox.Api/Files/CreateFolderArg.cs
Expand Up @@ -32,7 +32,10 @@ public class CreateFolderArg
/// class.</para>
/// </summary>
/// <param name="path">Path in the user's Dropbox to create.</param>
public CreateFolderArg(string path)
/// <param name="autorename">If there's a conflict, have the Dropbox server try to
/// autorename the folder to avoid the conflict.</param>
public CreateFolderArg(string path,
bool autorename = false)
{
if (path == null)
{
Expand All @@ -44,6 +47,7 @@ public CreateFolderArg(string path)
}

this.Path = path;
this.Autorename = autorename;
}

/// <summary>
Expand All @@ -54,13 +58,20 @@ public CreateFolderArg(string path)
/// deserializing.</remarks>
public CreateFolderArg()
{
this.Autorename = false;
}

/// <summary>
/// <para>Path in the user's Dropbox to create.</para>
/// </summary>
public string Path { get; protected set; }

/// <summary>
/// <para>If there's a conflict, have the Dropbox server try to autorename the folder
/// to avoid the conflict.</para>
/// </summary>
public bool Autorename { get; protected set; }

#region Encoder class

/// <summary>
Expand All @@ -76,6 +87,7 @@ private class CreateFolderArgEncoder : enc.StructEncoder<CreateFolderArg>
public override void EncodeFields(CreateFolderArg value, enc.IJsonWriter writer)
{
WriteProperty("path", value.Path, writer, enc.StringEncoder.Instance);
WriteProperty("autorename", value.Autorename, writer, enc.BooleanEncoder.Instance);
}
}

Expand Down Expand Up @@ -111,6 +123,9 @@ protected override void SetField(CreateFolderArg value, string fieldName, enc.IJ
case "path":
value.Path = enc.StringDecoder.Instance.Decode(reader);
break;
case "autorename":
value.Autorename = enc.BooleanDecoder.Instance.Decode(reader);
break;
default:
reader.Skip();
break;
Expand Down

0 comments on commit 54d9036

Please sign in to comment.