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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,24 @@ public partial class FaceClient : ServiceClient<FaceClient>, IFaceClient
/// </summary>
public virtual ILargeFaceListOperations LargeFaceList { get; private set; }

/// <summary>
/// Gets the ISnapshotOperations.
/// </summary>
public virtual ISnapshotOperations Snapshot { get; private set; }

/// <summary>
/// Initializes a new instance of the FaceClient class.
/// </summary>
/// <param name='httpClient'>
/// HttpClient to be used
/// </param>
/// <param name='disposeHttpClient'>
/// True: will dispose the provided httpClient on calling FaceClient.Dispose(). False: will not dispose provided httpClient</param>
protected FaceClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
{
Initialize();
}

/// <summary>
/// Initializes a new instance of the FaceClient class.
/// </summary>
Expand Down Expand Up @@ -135,6 +153,33 @@ public FaceClient(ServiceClientCredentials credentials, params DelegatingHandler
}
}

/// <summary>
/// Initializes a new instance of the FaceClient class.
/// </summary>
/// <param name='credentials'>
/// Required. Subscription credentials which uniquely identify client subscription.
/// </param>
/// <param name='httpClient'>
/// HttpClient to be used
/// </param>
/// <param name='disposeHttpClient'>
/// True: will dispose the provided httpClient on calling FaceClient.Dispose(). False: will not dispose provided httpClient</param>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
public FaceClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient)
{
if (credentials == null)
{
throw new System.ArgumentNullException("credentials");
}
Credentials = credentials;
if (Credentials != null)
{
Credentials.InitializeServiceClient(this);
}
}

/// <summary>
/// Initializes a new instance of the FaceClient class.
/// </summary>
Expand Down Expand Up @@ -179,6 +224,7 @@ private void Initialize()
LargePersonGroupPerson = new LargePersonGroupPerson(this);
LargePersonGroup = new LargePersonGroupOperations(this);
LargeFaceList = new LargeFaceListOperations(this);
Snapshot = new SnapshotOperations(this);
BaseUri = "{Endpoint}/face/v1.0";
SerializationSettings = new JsonSerializerSettings
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,10 @@ public partial interface IFaceClient : System.IDisposable
/// </summary>
ILargeFaceListOperations LargeFaceList { get; }

/// <summary>
/// Gets the ISnapshotOperations.
/// </summary>
ISnapshotOperations Snapshot { get; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.Azure.CognitiveServices.Vision.Face
{
using Microsoft.Rest;
using Models;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

/// <summary>
/// SnapshotOperations operations.
/// </summary>
public partial interface ISnapshotOperations
{
/// <summary>
/// Take a snapshot.
/// </summary>
/// <param name='type'>
/// User specified type, maximum length is 128.
/// </param>
/// <param name='objectId'>
/// User specified objectId, maximum length is 128.
/// </param>
/// <param name='applyScope'>
/// Array of applyScope
/// </param>
/// <param name='context'>
/// User specified context, maximum length is 128.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="APIErrorException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<HttpOperationHeaderResponse<SnapshotTakeHeaders>> TakeWithHttpMessagesAsync(string type = default(string), string objectId = default(string), IList<System.Guid> applyScope = default(IList<System.Guid>), string context = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Get snapshot list.
/// </summary>
/// <param name='type'>
/// User specified type.
/// </param>
/// <param name='applyScope'>
/// User specified apply scope.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="APIErrorException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<HttpOperationResponse<IList<Snapshot>>> ListWithHttpMessagesAsync(string type, IList<object> applyScope, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Get a snapshot.
/// </summary>
/// <param name='snapshotId'>
/// Id referencing a particular snapshot.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="APIErrorException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<HttpOperationResponse<Snapshot>> GetWithHttpMessagesAsync(string snapshotId, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Update a snapshot.
/// </summary>
/// <param name='snapshotId'>
/// Id referencing a particular snapshot.
/// </param>
/// <param name='applyScope'>
/// Array of applyScope
/// </param>
/// <param name='context'>
/// User specified context, maximum length is 1024.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="APIErrorException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<HttpOperationResponse> UpdateWithHttpMessagesAsync(string snapshotId, IList<System.Guid> applyScope = default(IList<System.Guid>), string context = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Delete an existing snapshot.
/// </summary>
/// <param name='snapshotId'>
/// Id referencing a particular snapshot.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="APIErrorException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<HttpOperationResponse> DeleteWithHttpMessagesAsync(string snapshotId, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Apply a snapshot.
/// </summary>
/// <param name='snapshotId'>
/// Id referencing a particular snapshot.
/// </param>
/// <param name='objectId'>
/// User specified objectId, maximum length is 128.
/// </param>
/// <param name='mode'>
/// User specified context, maximum length is 128.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="APIErrorException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<HttpOperationHeaderResponse<SnapshotApplyHeaders>> ApplyWithHttpMessagesAsync(string snapshotId, string objectId = default(string), string mode = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Retrieve the take/apply status of a snapshot operation.
/// </summary>
/// <param name='snapshotId'>
/// Id referencing a particular snapshot.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="APIErrorException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<HttpOperationResponse<OperationStatus>> GetOperationStatusWithHttpMessagesAsync(string snapshotId, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.Azure.CognitiveServices.Vision.Face.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

/// <summary>
/// A combination of user defined applyScope and user specified data for
/// snapshot update.
/// </summary>
public partial class ApplyScopeAndContextContract
{
/// <summary>
/// Initializes a new instance of the ApplyScopeAndContextContract
/// class.
/// </summary>
public ApplyScopeAndContextContract()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the ApplyScopeAndContextContract
/// class.
/// </summary>
/// <param name="applyScope">Array of applyScope</param>
/// <param name="context">User specified context, maximum length is
/// 1024.</param>
public ApplyScopeAndContextContract(IList<System.Guid> applyScope = default(IList<System.Guid>), string context = default(string))
{
ApplyScope = applyScope;
Context = context;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets array of applyScope
/// </summary>
[JsonProperty(PropertyName = "applyScope")]
public IList<System.Guid> ApplyScope { get; set; }

/// <summary>
/// Gets or sets user specified context, maximum length is 1024.
/// </summary>
[JsonProperty(PropertyName = "context")]
public string Context { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (Context != null)
{
if (Context.Length > 1024)
{
throw new ValidationException(ValidationRules.MaxLength, "Context", 1024);
}
}
}
}
}
Loading