Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the TakeSnapshotRequest class.
 /// </summary>
 /// <param name="type">User specified type for the source object to
 /// take snapshot from. Currently FaceList, PersonGroup, LargeFaceList
 /// and LargePersonGroup are supported. Possible values include:
 /// 'FaceList', 'LargeFaceList', 'LargePersonGroup',
 /// 'PersonGroup'</param>
 /// <param name="objectId">User specified source object id to take
 /// snapshot from.</param>
 /// <param name="applyScope">User specified array of target Face
 /// subscription ids for the snapshot. For each snapshot, only
 /// subscriptions included in the applyScope of Snapshot - Take can
 /// apply it.</param>
 /// <param name="userData">User specified data about the snapshot for
 /// any purpose. Length should not exceed 16KB.</param>
 public TakeSnapshotRequest(SnapshotObjectType type, string objectId, IList <System.Guid?> applyScope, string userData = default(string))
 {
     Type       = type;
     ObjectId   = objectId;
     ApplyScope = applyScope;
     UserData   = userData;
     CustomInit();
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the Snapshot class.
 /// </summary>
 /// <param name="id">Snapshot id.</param>
 /// <param name="account">Azure Cognitive Service Face account id of
 /// the subscriber who created the snapshot by Snapshot - Take.</param>
 /// <param name="type">Type of the source object in the snapshot,
 /// specified by the subscriber who created the snapshot when calling
 /// Snapshot - Take. Currently FaceList, PersonGroup, LargeFaceList and
 /// LargePersonGroup are supported. Possible values include:
 /// 'FaceList', 'LargeFaceList', 'LargePersonGroup',
 /// 'PersonGroup'</param>
 /// <param name="applyScope">Array of the target Face subscription ids
 /// for the snapshot, specified by the user who created the snapshot
 /// when calling Snapshot - Take. For each snapshot, only subscriptions
 /// included in the applyScope of Snapshot - Take can apply it.</param>
 /// <param name="createdTime">A combined UTC date and time string that
 /// describes the created time of the snapshot. E.g.
 /// 2018-12-25T11:41:02.2331413Z.</param>
 /// <param name="lastUpdateTime">A combined UTC date and time string
 /// that describes the last time when the snapshot was created or
 /// updated by Snapshot - Update. E.g.
 /// 2018-12-25T11:51:27.8705696Z.</param>
 /// <param name="userData">User specified data about the snapshot for
 /// any purpose. Length should not exceed 16KB.</param>
 public Snapshot(System.Guid id, string account, SnapshotObjectType type, IList <System.Guid> applyScope, System.DateTime createdTime, System.DateTime lastUpdateTime, string userData = default(string))
 {
     Id             = id;
     Account        = account;
     Type           = type;
     ApplyScope     = applyScope;
     UserData       = userData;
     CreatedTime    = createdTime;
     LastUpdateTime = lastUpdateTime;
     CustomInit();
 }
Esempio n. 3
0
        internal static string ToSerializedValue(this SnapshotObjectType value)
        {
            switch (value)
            {
            case SnapshotObjectType.FaceList:
                return("FaceList");

            case SnapshotObjectType.LargeFaceList:
                return("LargeFaceList");

            case SnapshotObjectType.LargePersonGroup:
                return("LargePersonGroup");

            case SnapshotObjectType.PersonGroup:
                return("PersonGroup");
            }
            return(null);
        }
 /// <summary>
 /// Submit an operation to take a snapshot of face list, large face list,
 /// person group or large person group, with user-specified snapshot type,
 /// source object id, apply scope and an optional user data.
 /// The snapshot interfaces are for users to backup and restore their face data
 /// from one face subscription to another, inside same region or across
 /// regions. The workflow contains two phases, user first calls Snapshot - Take
 /// to create a copy of the source object and store it as a snapshot, then
 /// calls Snapshot - Apply to paste the snapshot to target subscription. The
 /// snapshots are stored in a centralized location (per Azure instance), so
 /// that they can be applied cross accounts and regions.
 /// Taking snapshot is an asynchronous operation. An operation id can be
 /// obtained from the "Operation-Location" field in response header, to be used
 /// in OperationStatus - Get for tracking the progress of creating the
 /// snapshot. The snapshot id will be included in the "resourceLocation" field
 /// in OperationStatus - Get response when the operation status is "succeeded".
 /// Snapshot taking time depends on the number of person and face entries in
 /// the source object. It could be in seconds, or up to several hours for
 /// 1,000,000 persons with multiple faces.
 /// Snapshots will be automatically expired and cleaned in 48 hours after it is
 /// created by Snapshot - Take. User can delete the snapshot using Snapshot -
 /// Delete by themselves any time before expiration.
 /// Taking snapshot for a certain object will not block any other operations
 /// against the object. All read-only operations (Get/List and
 /// Identify/FindSimilar/Verify) can be conducted as usual. For all writable
 /// operations, including Add/Update/Delete the source object or its
 /// persons/faces and Train, they are not blocked but not recommended because
 /// writable updates may not be reflected on the snapshot during its taking.
 /// After snapshot taking is completed, all readable and writable operations
 /// can work as normal. Snapshot will also include the training results of the
 /// source object, which means target subscription the snapshot applied to does
 /// not need re-train the target object before calling Identify/FindSimilar.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='type'>
 /// User specified type for the source object to take snapshot from. Currently
 /// FaceList, PersonGroup, LargeFaceList and LargePersonGroup are supported.
 /// Possible values include: 'FaceList', 'LargeFaceList', 'LargePersonGroup',
 /// 'PersonGroup'
 /// </param>
 /// <param name='objectId'>
 /// User specified source object id to take snapshot from.
 /// </param>
 /// <param name='applyScope'>
 /// User specified array of target Face subscription ids for the snapshot. For
 /// each snapshot, only subscriptions included in the applyScope of Snapshot -
 /// Take can apply it.
 /// </param>
 /// <param name='userData'>
 /// User specified data about the snapshot for any purpose. Length should not
 /// exceed 16KB.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <SnapshotTakeHeaders> TakeAsync(this ISnapshotOperations operations, SnapshotObjectType type, string objectId, IList <System.Guid> applyScope, string userData = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.TakeWithHttpMessagesAsync(type, objectId, applyScope, userData, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Headers);
     }
 }