azure_cognitiveservices_face 0.17.1 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/lib/1.0/generated/azure_cognitiveservices_face.rb +38 -22
  3. data/lib/1.0/generated/azure_cognitiveservices_face/face.rb +554 -77
  4. data/lib/1.0/generated/azure_cognitiveservices_face/face_client.rb +24 -5
  5. data/lib/1.0/generated/azure_cognitiveservices_face/face_list_operations.rb +169 -36
  6. data/lib/1.0/generated/azure_cognitiveservices_face/large_face_list_operations.rb +1559 -0
  7. data/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_operations.rb +854 -0
  8. data/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_person.rb +1151 -0
  9. data/lib/1.0/generated/azure_cognitiveservices_face/models/apply_snapshot_request.rb +69 -0
  10. data/lib/1.0/generated/azure_cognitiveservices_face/models/detected_face.rb +13 -0
  11. data/lib/1.0/generated/azure_cognitiveservices_face/models/face_attributes.rb +1 -1
  12. data/lib/1.0/generated/azure_cognitiveservices_face/models/face_list.rb +10 -1
  13. data/lib/1.0/generated/azure_cognitiveservices_face/models/find_similar_request.rb +23 -1
  14. data/lib/1.0/generated/azure_cognitiveservices_face/models/gender.rb +0 -1
  15. data/lib/1.0/generated/azure_cognitiveservices_face/models/identify_request.rb +34 -16
  16. data/lib/1.0/generated/azure_cognitiveservices_face/models/large_face_list.rb +81 -0
  17. data/lib/1.0/generated/azure_cognitiveservices_face/models/large_person_group.rb +81 -0
  18. data/lib/1.0/generated/azure_cognitiveservices_face/models/meta_data_contract.rb +72 -0
  19. data/lib/1.0/generated/azure_cognitiveservices_face/models/name_and_user_data_contract.rb +1 -1
  20. data/lib/1.0/generated/azure_cognitiveservices_face/models/operation_status.rb +112 -0
  21. data/lib/1.0/generated/azure_cognitiveservices_face/models/operation_status_type.rb +18 -0
  22. data/lib/1.0/generated/azure_cognitiveservices_face/models/person_group.rb +11 -2
  23. data/lib/1.0/generated/azure_cognitiveservices_face/models/recognition_model.rb +16 -0
  24. data/lib/1.0/generated/azure_cognitiveservices_face/models/snapshot.rb +136 -0
  25. data/lib/1.0/generated/azure_cognitiveservices_face/models/snapshot_apply_mode.rb +15 -0
  26. data/lib/1.0/generated/azure_cognitiveservices_face/models/snapshot_object_type.rb +18 -0
  27. data/lib/1.0/generated/azure_cognitiveservices_face/models/take_snapshot_request.rb +101 -0
  28. data/lib/1.0/generated/azure_cognitiveservices_face/models/training_status.rb +25 -7
  29. data/lib/1.0/generated/azure_cognitiveservices_face/models/{update_person_face_request.rb → update_face_request.rb} +5 -5
  30. data/lib/1.0/generated/azure_cognitiveservices_face/models/update_snapshot_request.rb +73 -0
  31. data/lib/1.0/generated/azure_cognitiveservices_face/models/verify_face_to_face_request.rb +1 -1
  32. data/lib/1.0/generated/azure_cognitiveservices_face/models/verify_face_to_person_request.rb +27 -7
  33. data/lib/1.0/generated/azure_cognitiveservices_face/person_group_operations.rb +203 -34
  34. data/lib/1.0/generated/azure_cognitiveservices_face/person_group_person.rb +49 -29
  35. data/lib/1.0/generated/azure_cognitiveservices_face/snapshot_operations.rb +969 -0
  36. data/lib/profiles/latest/modules/face_profile_module.rb +125 -69
  37. data/lib/version.rb +1 -1
  38. metadata +19 -3
@@ -15,20 +15,30 @@ module Azure::CognitiveServices::Face::V1_0
15
15
  # @return [TrainingStatusType] Training status: notstarted, running,
16
16
  # succeeded, failed. If the training process is waiting to perform, the
17
17
  # status is notstarted. If the training is ongoing, the status is
18
- # running. Status succeed means this person group is ready for Face -
19
- # Identify. Status failed is often caused by no person or no persisted
20
- # face exist in the person group. Possible values include: 'nonstarted',
21
- # 'running', 'succeeded', 'failed'
18
+ # running. Status succeed means this person group or large person group
19
+ # is ready for Face - Identify, or this large face list is ready for Face
20
+ # - Find Similar. Status failed is often caused by no person or no
21
+ # persisted face exist in the person group or large person group, or no
22
+ # persisted face exist in the large face list. Possible values include:
23
+ # 'nonstarted', 'running', 'succeeded', 'failed'
22
24
  attr_accessor :status
23
25
 
24
26
  # @return [DateTime] A combined UTC date and time string that describes
25
- # person group created time.
27
+ # the created time of the person group, large person group or large face
28
+ # list.
26
29
  attr_accessor :created
27
30
 
28
- # @return [DateTime] Person group last modify time in the UTC, could be
29
- # null value when the person group is not successfully trained.
31
+ # @return [DateTime] A combined UTC date and time string that describes
32
+ # the last modify time of the person group, large person group or large
33
+ # face list, could be null value when the group is not successfully
34
+ # trained.
30
35
  attr_accessor :last_action
31
36
 
37
+ # @return [DateTime] A combined UTC date and time string that describes
38
+ # the last successful training time of the person group, large person
39
+ # group or large face list.
40
+ attr_accessor :last_successful_training
41
+
32
42
  # @return [String] Show failure message when training failed (omitted
33
43
  # when training succeed).
34
44
  attr_accessor :message
@@ -72,6 +82,14 @@ module Azure::CognitiveServices::Face::V1_0
72
82
  name: 'DateTime'
73
83
  }
74
84
  },
85
+ last_successful_training: {
86
+ client_side_validation: true,
87
+ required: false,
88
+ serialized_name: 'lastSuccessfulTrainingDateTime',
89
+ type: {
90
+ name: 'DateTime'
91
+ }
92
+ },
75
93
  message: {
76
94
  client_side_validation: true,
77
95
  required: false,
@@ -6,9 +6,9 @@
6
6
  module Azure::CognitiveServices::Face::V1_0
7
7
  module Models
8
8
  #
9
- # Request to update person face data.
9
+ # Request to update face data.
10
10
  #
11
- class UpdatePersonFaceRequest
11
+ class UpdateFaceRequest
12
12
 
13
13
  include MsRestAzure
14
14
 
@@ -18,17 +18,17 @@ module Azure::CognitiveServices::Face::V1_0
18
18
 
19
19
 
20
20
  #
21
- # Mapper for UpdatePersonFaceRequest class as Ruby Hash.
21
+ # Mapper for UpdateFaceRequest class as Ruby Hash.
22
22
  # This will be used for serialization/deserialization.
23
23
  #
24
24
  def self.mapper()
25
25
  {
26
26
  client_side_validation: true,
27
27
  required: false,
28
- serialized_name: 'UpdatePersonFaceRequest',
28
+ serialized_name: 'UpdateFaceRequest',
29
29
  type: {
30
30
  name: 'Composite',
31
- class_name: 'UpdatePersonFaceRequest',
31
+ class_name: 'UpdateFaceRequest',
32
32
  model_properties: {
33
33
  user_data: {
34
34
  client_side_validation: true,
@@ -0,0 +1,73 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CognitiveServices::Face::V1_0
7
+ module Models
8
+ #
9
+ # Request body for updating a snapshot, with a combination of user defined
10
+ # apply scope and user specified data.
11
+ #
12
+ class UpdateSnapshotRequest
13
+
14
+ include MsRestAzure
15
+
16
+ # @return Array of the target Face subscription ids for the snapshot,
17
+ # specified by the user who created the snapshot when calling Snapshot -
18
+ # Take. For each snapshot, only subscriptions included in the applyScope
19
+ # of Snapshot - Take can apply it.
20
+ attr_accessor :apply_scope
21
+
22
+ # @return [String] User specified data about the snapshot for any
23
+ # purpose. Length should not exceed 16KB.
24
+ attr_accessor :user_data
25
+
26
+
27
+ #
28
+ # Mapper for UpdateSnapshotRequest class as Ruby Hash.
29
+ # This will be used for serialization/deserialization.
30
+ #
31
+ def self.mapper()
32
+ {
33
+ client_side_validation: true,
34
+ required: false,
35
+ serialized_name: 'UpdateSnapshotRequest',
36
+ type: {
37
+ name: 'Composite',
38
+ class_name: 'UpdateSnapshotRequest',
39
+ model_properties: {
40
+ apply_scope: {
41
+ client_side_validation: true,
42
+ required: false,
43
+ serialized_name: 'applyScope',
44
+ type: {
45
+ name: 'Sequence',
46
+ element: {
47
+ client_side_validation: true,
48
+ required: false,
49
+ serialized_name: 'UuidElementType',
50
+ type: {
51
+ name: 'String'
52
+ }
53
+ }
54
+ }
55
+ },
56
+ user_data: {
57
+ client_side_validation: true,
58
+ required: false,
59
+ serialized_name: 'userData',
60
+ constraints: {
61
+ MaxLength: 16384
62
+ },
63
+ type: {
64
+ name: 'String'
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ end
71
+ end
72
+ end
73
+ end
@@ -6,7 +6,7 @@
6
6
  module Azure::CognitiveServices::Face::V1_0
7
7
  module Models
8
8
  #
9
- # Request body for verify operation.
9
+ # Request body for face to face verification.
10
10
  #
11
11
  class VerifyFaceToFaceRequest
12
12
 
@@ -6,22 +6,30 @@
6
6
  module Azure::CognitiveServices::Face::V1_0
7
7
  module Models
8
8
  #
9
- # Request body for verify operation.
9
+ # Request body for face to person verification.
10
10
  #
11
11
  class VerifyFaceToPersonRequest
12
12
 
13
13
  include MsRestAzure
14
14
 
15
- # @return FaceId the face, comes from Face - Detect
15
+ # @return FaceId of the face, comes from Face - Detect
16
16
  attr_accessor :face_id
17
17
 
18
18
  # @return [String] Using existing personGroupId and personId for fast
19
- # loading a specified person. personGroupId is created in Person
20
- # Groups.Create.
19
+ # loading a specified person. personGroupId is created in PersonGroup -
20
+ # Create. Parameter personGroupId and largePersonGroupId should not be
21
+ # provided at the same time.
21
22
  attr_accessor :person_group_id
22
23
 
23
- # @return Specify a certain person in a person group. personId is created
24
- # in Persons.Create.
24
+ # @return [String] Using existing largePersonGroupId and personId for
25
+ # fast loading a specified person. largePersonGroupId is created in
26
+ # LargePersonGroup - Create. Parameter personGroupId and
27
+ # largePersonGroupId should not be provided at the same time.
28
+ attr_accessor :large_person_group_id
29
+
30
+ # @return Specify a certain person in a person group or a large person
31
+ # group. personId is created in PersonGroup Person - Create or
32
+ # LargePersonGroup Person - Create.
25
33
  attr_accessor :person_id
26
34
 
27
35
 
@@ -48,7 +56,7 @@ module Azure::CognitiveServices::Face::V1_0
48
56
  },
49
57
  person_group_id: {
50
58
  client_side_validation: true,
51
- required: true,
59
+ required: false,
52
60
  serialized_name: 'personGroupId',
53
61
  constraints: {
54
62
  MaxLength: 64,
@@ -58,6 +66,18 @@ module Azure::CognitiveServices::Face::V1_0
58
66
  name: 'String'
59
67
  }
60
68
  },
69
+ large_person_group_id: {
70
+ client_side_validation: true,
71
+ required: false,
72
+ serialized_name: 'largePersonGroupId',
73
+ constraints: {
74
+ MaxLength: 64,
75
+ Pattern: '^[a-z0-9-_]+$'
76
+ },
77
+ type: {
78
+ name: 'String'
79
+ }
80
+ },
61
81
  person_id: {
62
82
  client_side_validation: true,
63
83
  required: true,
@@ -22,60 +22,158 @@ module Azure::CognitiveServices::Face::V1_0
22
22
  attr_reader :client
23
23
 
24
24
  #
25
- # Create a new person group with specified personGroupId, name and
26
- # user-provided userData.
25
+ # Create a new person group with specified personGroupId, name, user-provided
26
+ # userData and recognitionModel.
27
+ # <br /> A person group is the container of the uploaded person data, including
28
+ # face images and face recognition features.
29
+ # <br /> After creation, use [PersonGroup Person -
30
+ # Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523c)
31
+ # to add persons into the group, and then call [PersonGroup -
32
+ # Train](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395249)
33
+ # to get this group ready for [Face -
34
+ # Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239).
35
+ # <br /> The person's face, image, and userData will be stored on server until
36
+ # [PersonGroup Person -
37
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523d)
38
+ # or [PersonGroup -
39
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395245)
40
+ # is called.
41
+ # <br />
42
+ # * Free-tier subscription quota: 1,000 person groups. Each holds up to 1,000
43
+ # persons.
44
+ # * S0-tier subscription quota: 1,000,000 person groups. Each holds up to
45
+ # 10,000 persons.
46
+ # * to handle larger scale face identification problem, please consider using
47
+ # [LargePersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d).
48
+ # <br />
49
+ # 'recognitionModel' should be specified to associate with this person group.
50
+ # The default value for 'recognitionModel' is 'recognition_01', if the latest
51
+ # model needed, please explicitly specify the model you need in this parameter.
52
+ # New faces that are added to an existing person group will use the recognition
53
+ # model that's already associated with the collection. Existing face features
54
+ # in a person group can't be updated to features extracted by another version
55
+ # of recognition model.
56
+ #
27
57
  #
28
58
  # @param person_group_id [String] Id referencing a particular person group.
29
59
  # @param name [String] User defined name, maximum length is 128.
30
60
  # @param user_data [String] User specified data. Length should not exceed 16KB.
61
+ # @param recognition_model [RecognitionModel] Possible values include:
62
+ # 'recognition_01', 'recognition_02'
31
63
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
64
  # will be added to the HTTP request.
33
65
  #
34
66
  #
35
- def create(person_group_id, name:nil, user_data:nil, custom_headers:nil)
36
- response = create_async(person_group_id, name:name, user_data:user_data, custom_headers:custom_headers).value!
67
+ def create(person_group_id, name:nil, user_data:nil, recognition_model:nil, custom_headers:nil)
68
+ response = create_async(person_group_id, name:name, user_data:user_data, recognition_model:recognition_model, custom_headers:custom_headers).value!
37
69
  nil
38
70
  end
39
71
 
40
72
  #
41
- # Create a new person group with specified personGroupId, name and
42
- # user-provided userData.
73
+ # Create a new person group with specified personGroupId, name, user-provided
74
+ # userData and recognitionModel.
75
+ # <br /> A person group is the container of the uploaded person data, including
76
+ # face images and face recognition features.
77
+ # <br /> After creation, use [PersonGroup Person -
78
+ # Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523c)
79
+ # to add persons into the group, and then call [PersonGroup -
80
+ # Train](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395249)
81
+ # to get this group ready for [Face -
82
+ # Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239).
83
+ # <br /> The person's face, image, and userData will be stored on server until
84
+ # [PersonGroup Person -
85
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523d)
86
+ # or [PersonGroup -
87
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395245)
88
+ # is called.
89
+ # <br />
90
+ # * Free-tier subscription quota: 1,000 person groups. Each holds up to 1,000
91
+ # persons.
92
+ # * S0-tier subscription quota: 1,000,000 person groups. Each holds up to
93
+ # 10,000 persons.
94
+ # * to handle larger scale face identification problem, please consider using
95
+ # [LargePersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d).
96
+ # <br />
97
+ # 'recognitionModel' should be specified to associate with this person group.
98
+ # The default value for 'recognitionModel' is 'recognition_01', if the latest
99
+ # model needed, please explicitly specify the model you need in this parameter.
100
+ # New faces that are added to an existing person group will use the recognition
101
+ # model that's already associated with the collection. Existing face features
102
+ # in a person group can't be updated to features extracted by another version
103
+ # of recognition model.
104
+ #
43
105
  #
44
106
  # @param person_group_id [String] Id referencing a particular person group.
45
107
  # @param name [String] User defined name, maximum length is 128.
46
108
  # @param user_data [String] User specified data. Length should not exceed 16KB.
109
+ # @param recognition_model [RecognitionModel] Possible values include:
110
+ # 'recognition_01', 'recognition_02'
47
111
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
48
112
  # will be added to the HTTP request.
49
113
  #
50
114
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
51
115
  #
52
- def create_with_http_info(person_group_id, name:nil, user_data:nil, custom_headers:nil)
53
- create_async(person_group_id, name:name, user_data:user_data, custom_headers:custom_headers).value!
116
+ def create_with_http_info(person_group_id, name:nil, user_data:nil, recognition_model:nil, custom_headers:nil)
117
+ create_async(person_group_id, name:name, user_data:user_data, recognition_model:recognition_model, custom_headers:custom_headers).value!
54
118
  end
55
119
 
56
120
  #
57
- # Create a new person group with specified personGroupId, name and
58
- # user-provided userData.
121
+ # Create a new person group with specified personGroupId, name, user-provided
122
+ # userData and recognitionModel.
123
+ # <br /> A person group is the container of the uploaded person data, including
124
+ # face images and face recognition features.
125
+ # <br /> After creation, use [PersonGroup Person -
126
+ # Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523c)
127
+ # to add persons into the group, and then call [PersonGroup -
128
+ # Train](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395249)
129
+ # to get this group ready for [Face -
130
+ # Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239).
131
+ # <br /> The person's face, image, and userData will be stored on server until
132
+ # [PersonGroup Person -
133
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523d)
134
+ # or [PersonGroup -
135
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395245)
136
+ # is called.
137
+ # <br />
138
+ # * Free-tier subscription quota: 1,000 person groups. Each holds up to 1,000
139
+ # persons.
140
+ # * S0-tier subscription quota: 1,000,000 person groups. Each holds up to
141
+ # 10,000 persons.
142
+ # * to handle larger scale face identification problem, please consider using
143
+ # [LargePersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d).
144
+ # <br />
145
+ # 'recognitionModel' should be specified to associate with this person group.
146
+ # The default value for 'recognitionModel' is 'recognition_01', if the latest
147
+ # model needed, please explicitly specify the model you need in this parameter.
148
+ # New faces that are added to an existing person group will use the recognition
149
+ # model that's already associated with the collection. Existing face features
150
+ # in a person group can't be updated to features extracted by another version
151
+ # of recognition model.
152
+ #
59
153
  #
60
154
  # @param person_group_id [String] Id referencing a particular person group.
61
155
  # @param name [String] User defined name, maximum length is 128.
62
156
  # @param user_data [String] User specified data. Length should not exceed 16KB.
157
+ # @param recognition_model [RecognitionModel] Possible values include:
158
+ # 'recognition_01', 'recognition_02'
63
159
  # @param [Hash{String => String}] A hash of custom headers that will be added
64
160
  # to the HTTP request.
65
161
  #
66
162
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
67
163
  #
68
- def create_async(person_group_id, name:nil, user_data:nil, custom_headers:nil)
164
+ def create_async(person_group_id, name:nil, user_data:nil, recognition_model:nil, custom_headers:nil)
165
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
69
166
  fail ArgumentError, 'person_group_id is nil' if person_group_id.nil?
70
167
  fail ArgumentError, "'person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !person_group_id.nil? && person_group_id.length > 64
71
168
  fail ArgumentError, "'person_group_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !person_group_id.nil? && person_group_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
72
169
  fail ArgumentError, "'name' should satisfy the constraint - 'MaxLength': '128'" if !name.nil? && name.length > 128
73
170
  fail ArgumentError, "'user_data' should satisfy the constraint - 'MaxLength': '16384'" if !user_data.nil? && user_data.length > 16384
74
171
 
75
- body = NameAndUserDataContract.new
76
- unless name.nil? && user_data.nil?
172
+ body = MetaDataContract.new
173
+ unless name.nil? && user_data.nil? && recognition_model.nil?
77
174
  body.name = name
78
175
  body.user_data = user_data
176
+ body.recognition_model = recognition_model
79
177
  end
80
178
 
81
179
  request_headers = {}
@@ -86,13 +184,14 @@ module Azure::CognitiveServices::Face::V1_0
86
184
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
87
185
 
88
186
  # Serialize Request
89
- request_mapper = Azure::CognitiveServices::Face::V1_0::Models::NameAndUserDataContract.mapper()
187
+ request_mapper = Azure::CognitiveServices::Face::V1_0::Models::MetaDataContract.mapper()
90
188
  request_content = @client.serialize(request_mapper, body)
91
189
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
92
190
 
93
191
  path_template = 'persongroups/{personGroupId}'
94
192
 
95
193
  request_url = @base_url || @client.base_url
194
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
96
195
 
97
196
  options = {
98
197
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -121,7 +220,7 @@ module Azure::CognitiveServices::Face::V1_0
121
220
  end
122
221
 
123
222
  #
124
- # Delete an existing person group. Persisted face images of all people in the
223
+ # Delete an existing person group. Persisted face features of all people in the
125
224
  # person group will also be deleted.
126
225
  #
127
226
  # @param person_group_id [String] Id referencing a particular person group.
@@ -135,7 +234,7 @@ module Azure::CognitiveServices::Face::V1_0
135
234
  end
136
235
 
137
236
  #
138
- # Delete an existing person group. Persisted face images of all people in the
237
+ # Delete an existing person group. Persisted face features of all people in the
139
238
  # person group will also be deleted.
140
239
  #
141
240
  # @param person_group_id [String] Id referencing a particular person group.
@@ -149,7 +248,7 @@ module Azure::CognitiveServices::Face::V1_0
149
248
  end
150
249
 
151
250
  #
152
- # Delete an existing person group. Persisted face images of all people in the
251
+ # Delete an existing person group. Persisted face features of all people in the
153
252
  # person group will also be deleted.
154
253
  #
155
254
  # @param person_group_id [String] Id referencing a particular person group.
@@ -159,6 +258,7 @@ module Azure::CognitiveServices::Face::V1_0
159
258
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
160
259
  #
161
260
  def delete_async(person_group_id, custom_headers:nil)
261
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
162
262
  fail ArgumentError, 'person_group_id is nil' if person_group_id.nil?
163
263
  fail ArgumentError, "'person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !person_group_id.nil? && person_group_id.length > 64
164
264
  fail ArgumentError, "'person_group_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !person_group_id.nil? && person_group_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
@@ -173,6 +273,7 @@ module Azure::CognitiveServices::Face::V1_0
173
273
  path_template = 'persongroups/{personGroupId}'
174
274
 
175
275
  request_url = @base_url || @client.base_url
276
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
176
277
 
177
278
  options = {
178
279
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -200,42 +301,55 @@ module Azure::CognitiveServices::Face::V1_0
200
301
  end
201
302
 
202
303
  #
203
- # Retrieve the information of a person group, including its name and userData.
304
+ # Retrieve person group name, userData and recognitionModel. To get person
305
+ # information under this personGroup, use [PersonGroup Person -
306
+ # List](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395241).
204
307
  #
205
308
  # @param person_group_id [String] Id referencing a particular person group.
309
+ # @param return_recognition_model [Boolean] A value indicating whether the
310
+ # operation should return 'recognitionModel' in response.
206
311
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
207
312
  # will be added to the HTTP request.
208
313
  #
209
314
  # @return [PersonGroup] operation results.
210
315
  #
211
- def get(person_group_id, custom_headers:nil)
212
- response = get_async(person_group_id, custom_headers:custom_headers).value!
316
+ def get(person_group_id, return_recognition_model:false, custom_headers:nil)
317
+ response = get_async(person_group_id, return_recognition_model:return_recognition_model, custom_headers:custom_headers).value!
213
318
  response.body unless response.nil?
214
319
  end
215
320
 
216
321
  #
217
- # Retrieve the information of a person group, including its name and userData.
322
+ # Retrieve person group name, userData and recognitionModel. To get person
323
+ # information under this personGroup, use [PersonGroup Person -
324
+ # List](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395241).
218
325
  #
219
326
  # @param person_group_id [String] Id referencing a particular person group.
327
+ # @param return_recognition_model [Boolean] A value indicating whether the
328
+ # operation should return 'recognitionModel' in response.
220
329
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
221
330
  # will be added to the HTTP request.
222
331
  #
223
332
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
224
333
  #
225
- def get_with_http_info(person_group_id, custom_headers:nil)
226
- get_async(person_group_id, custom_headers:custom_headers).value!
334
+ def get_with_http_info(person_group_id, return_recognition_model:false, custom_headers:nil)
335
+ get_async(person_group_id, return_recognition_model:return_recognition_model, custom_headers:custom_headers).value!
227
336
  end
228
337
 
229
338
  #
230
- # Retrieve the information of a person group, including its name and userData.
339
+ # Retrieve person group name, userData and recognitionModel. To get person
340
+ # information under this personGroup, use [PersonGroup Person -
341
+ # List](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395241).
231
342
  #
232
343
  # @param person_group_id [String] Id referencing a particular person group.
344
+ # @param return_recognition_model [Boolean] A value indicating whether the
345
+ # operation should return 'recognitionModel' in response.
233
346
  # @param [Hash{String => String}] A hash of custom headers that will be added
234
347
  # to the HTTP request.
235
348
  #
236
349
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
237
350
  #
238
- def get_async(person_group_id, custom_headers:nil)
351
+ def get_async(person_group_id, return_recognition_model:false, custom_headers:nil)
352
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
239
353
  fail ArgumentError, 'person_group_id is nil' if person_group_id.nil?
240
354
  fail ArgumentError, "'person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !person_group_id.nil? && person_group_id.length > 64
241
355
  fail ArgumentError, "'person_group_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !person_group_id.nil? && person_group_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
@@ -250,10 +364,12 @@ module Azure::CognitiveServices::Face::V1_0
250
364
  path_template = 'persongroups/{personGroupId}'
251
365
 
252
366
  request_url = @base_url || @client.base_url
367
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
253
368
 
254
369
  options = {
255
370
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
256
371
  path_params: {'personGroupId' => person_group_id},
372
+ query_params: {'returnRecognitionModel' => return_recognition_model},
257
373
  headers: request_headers.merge(custom_headers || {}),
258
374
  base_url: request_url
259
375
  }
@@ -331,6 +447,7 @@ module Azure::CognitiveServices::Face::V1_0
331
447
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
332
448
  #
333
449
  def update_async(person_group_id, name:nil, user_data:nil, custom_headers:nil)
450
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
334
451
  fail ArgumentError, 'person_group_id is nil' if person_group_id.nil?
335
452
  fail ArgumentError, "'person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !person_group_id.nil? && person_group_id.length > 64
336
453
  fail ArgumentError, "'person_group_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !person_group_id.nil? && person_group_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
@@ -358,6 +475,7 @@ module Azure::CognitiveServices::Face::V1_0
358
475
  path_template = 'persongroups/{personGroupId}'
359
476
 
360
477
  request_url = @base_url || @client.base_url
478
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
361
479
 
362
480
  options = {
363
481
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -422,6 +540,7 @@ module Azure::CognitiveServices::Face::V1_0
422
540
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
423
541
  #
424
542
  def get_training_status_async(person_group_id, custom_headers:nil)
543
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
425
544
  fail ArgumentError, 'person_group_id is nil' if person_group_id.nil?
426
545
  fail ArgumentError, "'person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !person_group_id.nil? && person_group_id.length > 64
427
546
  fail ArgumentError, "'person_group_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !person_group_id.nil? && person_group_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
@@ -436,6 +555,7 @@ module Azure::CognitiveServices::Face::V1_0
436
555
  path_template = 'persongroups/{personGroupId}/training'
437
556
 
438
557
  request_url = @base_url || @client.base_url
558
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
439
559
 
440
560
  options = {
441
561
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -473,48 +593,94 @@ module Azure::CognitiveServices::Face::V1_0
473
593
  end
474
594
 
475
595
  #
476
- # List person groups and their information.
596
+ # List person groups personGroupId, name, userData and recognitionModel.<br />
597
+ # * Person groups are stored in alphabetical order of personGroupId.
598
+ # * "start" parameter (string, optional) is a user-provided personGroupId value
599
+ # that returned entries have larger ids by string comparison. "start" set to
600
+ # empty to indicate return from the first item.
601
+ # * "top" parameter (int, optional) specifies the number of entries to return.
602
+ # A maximal of 1000 entries can be returned in one call. To fetch more, you can
603
+ # specify "start" with the last returned entry’s Id of the current call.
604
+ # <br />
605
+ # For example, total 5 person groups: "group1", ..., "group5".
606
+ # <br /> "start=&top=" will return all 5 groups.
607
+ # <br /> "start=&top=2" will return "group1", "group2".
608
+ # <br /> "start=group2&top=3" will return "group3", "group4", "group5".
609
+ #
477
610
  #
478
611
  # @param start [String] List person groups from the least personGroupId greater
479
612
  # than the "start".
480
613
  # @param top [Integer] The number of person groups to list.
614
+ # @param return_recognition_model [Boolean] A value indicating whether the
615
+ # operation should return 'recognitionModel' in response.
481
616
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
482
617
  # will be added to the HTTP request.
483
618
  #
484
619
  # @return [Array] operation results.
485
620
  #
486
- def list(start:nil, top:1000, custom_headers:nil)
487
- response = list_async(start:start, top:top, custom_headers:custom_headers).value!
621
+ def list(start:nil, top:1000, return_recognition_model:false, custom_headers:nil)
622
+ response = list_async(start:start, top:top, return_recognition_model:return_recognition_model, custom_headers:custom_headers).value!
488
623
  response.body unless response.nil?
489
624
  end
490
625
 
491
626
  #
492
- # List person groups and their information.
627
+ # List person groups personGroupId, name, userData and recognitionModel.<br />
628
+ # * Person groups are stored in alphabetical order of personGroupId.
629
+ # * "start" parameter (string, optional) is a user-provided personGroupId value
630
+ # that returned entries have larger ids by string comparison. "start" set to
631
+ # empty to indicate return from the first item.
632
+ # * "top" parameter (int, optional) specifies the number of entries to return.
633
+ # A maximal of 1000 entries can be returned in one call. To fetch more, you can
634
+ # specify "start" with the last returned entry’s Id of the current call.
635
+ # <br />
636
+ # For example, total 5 person groups: "group1", ..., "group5".
637
+ # <br /> "start=&top=" will return all 5 groups.
638
+ # <br /> "start=&top=2" will return "group1", "group2".
639
+ # <br /> "start=group2&top=3" will return "group3", "group4", "group5".
640
+ #
493
641
  #
494
642
  # @param start [String] List person groups from the least personGroupId greater
495
643
  # than the "start".
496
644
  # @param top [Integer] The number of person groups to list.
645
+ # @param return_recognition_model [Boolean] A value indicating whether the
646
+ # operation should return 'recognitionModel' in response.
497
647
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
498
648
  # will be added to the HTTP request.
499
649
  #
500
650
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
501
651
  #
502
- def list_with_http_info(start:nil, top:1000, custom_headers:nil)
503
- list_async(start:start, top:top, custom_headers:custom_headers).value!
652
+ def list_with_http_info(start:nil, top:1000, return_recognition_model:false, custom_headers:nil)
653
+ list_async(start:start, top:top, return_recognition_model:return_recognition_model, custom_headers:custom_headers).value!
504
654
  end
505
655
 
506
656
  #
507
- # List person groups and their information.
657
+ # List person groups personGroupId, name, userData and recognitionModel.<br />
658
+ # * Person groups are stored in alphabetical order of personGroupId.
659
+ # * "start" parameter (string, optional) is a user-provided personGroupId value
660
+ # that returned entries have larger ids by string comparison. "start" set to
661
+ # empty to indicate return from the first item.
662
+ # * "top" parameter (int, optional) specifies the number of entries to return.
663
+ # A maximal of 1000 entries can be returned in one call. To fetch more, you can
664
+ # specify "start" with the last returned entry’s Id of the current call.
665
+ # <br />
666
+ # For example, total 5 person groups: "group1", ..., "group5".
667
+ # <br /> "start=&top=" will return all 5 groups.
668
+ # <br /> "start=&top=2" will return "group1", "group2".
669
+ # <br /> "start=group2&top=3" will return "group3", "group4", "group5".
670
+ #
508
671
  #
509
672
  # @param start [String] List person groups from the least personGroupId greater
510
673
  # than the "start".
511
674
  # @param top [Integer] The number of person groups to list.
675
+ # @param return_recognition_model [Boolean] A value indicating whether the
676
+ # operation should return 'recognitionModel' in response.
512
677
  # @param [Hash{String => String}] A hash of custom headers that will be added
513
678
  # to the HTTP request.
514
679
  #
515
680
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
516
681
  #
517
- def list_async(start:nil, top:1000, custom_headers:nil)
682
+ def list_async(start:nil, top:1000, return_recognition_model:false, custom_headers:nil)
683
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
518
684
  fail ArgumentError, "'start' should satisfy the constraint - 'MaxLength': '64'" if !start.nil? && start.length > 64
519
685
  fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000
520
686
  fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
@@ -529,10 +695,11 @@ module Azure::CognitiveServices::Face::V1_0
529
695
  path_template = 'persongroups'
530
696
 
531
697
  request_url = @base_url || @client.base_url
698
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
532
699
 
533
700
  options = {
534
701
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
535
- query_params: {'start' => start,'top' => top},
702
+ query_params: {'start' => start,'top' => top,'returnRecognitionModel' => return_recognition_model},
536
703
  headers: request_headers.merge(custom_headers || {}),
537
704
  base_url: request_url
538
705
  }
@@ -620,6 +787,7 @@ module Azure::CognitiveServices::Face::V1_0
620
787
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
621
788
  #
622
789
  def train_async(person_group_id, custom_headers:nil)
790
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
623
791
  fail ArgumentError, 'person_group_id is nil' if person_group_id.nil?
624
792
  fail ArgumentError, "'person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !person_group_id.nil? && person_group_id.length > 64
625
793
  fail ArgumentError, "'person_group_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !person_group_id.nil? && person_group_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
@@ -634,6 +802,7 @@ module Azure::CognitiveServices::Face::V1_0
634
802
  path_template = 'persongroups/{personGroupId}/train'
635
803
 
636
804
  request_url = @base_url || @client.base_url
805
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
637
806
 
638
807
  options = {
639
808
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],