azure_mgmt_container_registry 0.18.4 → 0.18.5

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 (64) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-06-27-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  3. data/lib/2017-03-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  4. data/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  5. data/lib/2017-10-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  6. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  7. data/lib/2018-09-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  8. data/lib/2019-04-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  9. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry.rb +11 -7
  10. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  11. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/active_directory_object.rb +62 -0
  12. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/created_by_type.rb +18 -0
  13. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/generate_credentials_parameters.rb +2 -4
  14. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/last_modified_by_type.rb +18 -0
  15. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/proxy_resource.rb +14 -0
  16. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/scope_map.rb +12 -2
  17. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/system_data.rb +105 -0
  18. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/token.rb +12 -14
  19. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/token_credentials_properties.rb +12 -0
  20. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/token_password.rb +2 -2
  21. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/{status.rb → token_status.rb} +2 -2
  22. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/token_update_parameters.rb +2 -2
  23. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/scope_maps.rb +4 -4
  24. data/lib/2019-05-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  25. data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/operation_service_specification_definition.rb +1 -1
  26. data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/quarantine_policy.rb +3 -1
  27. data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/retention_policy.rb +6 -3
  28. data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/trust_policy.rb +5 -2
  29. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry.rb +37 -22
  30. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/agent_pools.rb +958 -0
  31. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +9 -1
  32. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/agent_pool.rb +157 -0
  33. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/agent_pool_list_result.rb +99 -0
  34. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/agent_pool_queue_status.rb +46 -0
  35. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/agent_pool_update_parameters.rb +65 -0
  36. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/created_by_type.rb +18 -0
  37. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/docker_build_request.rb +16 -0
  38. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/encoded_task_run_request.rb +16 -0
  39. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/error_response.rb +48 -0
  40. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/error_response_body.rb +81 -0
  41. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/file_task_run_request.rb +16 -0
  42. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/inner_error_description.rb +68 -0
  43. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/last_modified_by_type.rb +18 -0
  44. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/proxy_resource.rb +14 -0
  45. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/resource.rb +14 -0
  46. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/run.rb +34 -0
  47. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_filter.rb +12 -0
  48. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_get_log_result.rb +12 -0
  49. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_request.rb +23 -0
  50. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/system_data.rb +105 -0
  51. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task.rb +48 -2
  52. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_run.rb +149 -0
  53. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_run_list_result.rb +99 -0
  54. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_run_request.rb +16 -0
  55. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_run_update_parameters.rb +103 -0
  56. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_update_parameters.rb +23 -0
  57. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/registries.rb +2 -2
  58. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/runs.rb +6 -6
  59. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/task_runs.rb +953 -0
  60. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/tasks.rb +7 -7
  61. data/lib/azure_mgmt_container_registry.rb +5 -5
  62. data/lib/profiles/latest/modules/containerregistry_profile_module.rb +211 -83
  63. data/lib/version.rb +1 -1
  64. metadata +23 -4
@@ -50,6 +50,22 @@ module Azure::ContainerRegistry::Mgmt::V2019_06_01_preview
50
50
  name: 'Boolean'
51
51
  }
52
52
  },
53
+ agent_pool_name: {
54
+ client_side_validation: true,
55
+ required: false,
56
+ serialized_name: 'agentPoolName',
57
+ type: {
58
+ name: 'String'
59
+ }
60
+ },
61
+ log_template: {
62
+ client_side_validation: true,
63
+ required: false,
64
+ serialized_name: 'logTemplate',
65
+ type: {
66
+ name: 'String'
67
+ }
68
+ },
53
69
  type: {
54
70
  client_side_validation: true,
55
71
  required: true,
@@ -0,0 +1,103 @@
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::ContainerRegistry::Mgmt::V2019_06_01_preview
7
+ module Models
8
+ #
9
+ # The parameters for updating a task run.
10
+ #
11
+ class TaskRunUpdateParameters
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [IdentityProperties] Identity for the resource.
16
+ attr_accessor :identity
17
+
18
+ # @return [RunRequest] The request (parameters) for the new run
19
+ attr_accessor :run_request
20
+
21
+ # @return [String] How the run should be forced to rerun even if the run
22
+ # request configuration has not changed
23
+ attr_accessor :force_update_tag
24
+
25
+ # @return [String] The location of the resource
26
+ attr_accessor :location
27
+
28
+ # @return [Hash{String => String}] The ARM resource tags.
29
+ attr_accessor :tags
30
+
31
+
32
+ #
33
+ # Mapper for TaskRunUpdateParameters class as Ruby Hash.
34
+ # This will be used for serialization/deserialization.
35
+ #
36
+ def self.mapper()
37
+ {
38
+ client_side_validation: true,
39
+ required: false,
40
+ serialized_name: 'TaskRunUpdateParameters',
41
+ type: {
42
+ name: 'Composite',
43
+ class_name: 'TaskRunUpdateParameters',
44
+ model_properties: {
45
+ identity: {
46
+ client_side_validation: true,
47
+ required: false,
48
+ serialized_name: 'identity',
49
+ type: {
50
+ name: 'Composite',
51
+ class_name: 'IdentityProperties'
52
+ }
53
+ },
54
+ run_request: {
55
+ client_side_validation: true,
56
+ required: false,
57
+ serialized_name: 'properties.runRequest',
58
+ type: {
59
+ name: 'Composite',
60
+ polymorphic_discriminator: 'type',
61
+ uber_parent: 'RunRequest',
62
+ class_name: 'RunRequest'
63
+ }
64
+ },
65
+ force_update_tag: {
66
+ client_side_validation: true,
67
+ required: false,
68
+ serialized_name: 'properties.forceUpdateTag',
69
+ type: {
70
+ name: 'String'
71
+ }
72
+ },
73
+ location: {
74
+ client_side_validation: true,
75
+ required: false,
76
+ serialized_name: 'location',
77
+ type: {
78
+ name: 'String'
79
+ }
80
+ },
81
+ tags: {
82
+ client_side_validation: true,
83
+ required: false,
84
+ serialized_name: 'tags',
85
+ type: {
86
+ name: 'Dictionary',
87
+ value: {
88
+ client_side_validation: true,
89
+ required: false,
90
+ serialized_name: 'StringElementType',
91
+ type: {
92
+ name: 'String'
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }
98
+ }
99
+ }
100
+ end
101
+ end
102
+ end
103
+ end
@@ -26,6 +26,9 @@ module Azure::ContainerRegistry::Mgmt::V2019_06_01_preview
26
26
  # @return [AgentProperties] The machine configuration of the run agent.
27
27
  attr_accessor :agent_configuration
28
28
 
29
+ # @return [String] The dedicated agent pool for the task.
30
+ attr_accessor :agent_pool_name
31
+
29
32
  # @return [Integer] Run timeout in seconds.
30
33
  attr_accessor :timeout
31
34
 
@@ -41,6 +44,10 @@ module Azure::ContainerRegistry::Mgmt::V2019_06_01_preview
41
44
  # credentials that will be used when this run is invoked.
42
45
  attr_accessor :credentials
43
46
 
47
+ # @return [String] The template that describes the repository and tag
48
+ # information for run log artifact.
49
+ attr_accessor :log_template
50
+
44
51
  # @return [Hash{String => String}] The ARM resource tags.
45
52
  attr_accessor :tags
46
53
 
@@ -93,6 +100,14 @@ module Azure::ContainerRegistry::Mgmt::V2019_06_01_preview
93
100
  class_name: 'AgentProperties'
94
101
  }
95
102
  },
103
+ agent_pool_name: {
104
+ client_side_validation: true,
105
+ required: false,
106
+ serialized_name: 'properties.agentPoolName',
107
+ type: {
108
+ name: 'String'
109
+ }
110
+ },
96
111
  timeout: {
97
112
  client_side_validation: true,
98
113
  required: false,
@@ -130,6 +145,14 @@ module Azure::ContainerRegistry::Mgmt::V2019_06_01_preview
130
145
  class_name: 'Credentials'
131
146
  }
132
147
  },
148
+ log_template: {
149
+ client_side_validation: true,
150
+ required: false,
151
+ serialized_name: 'properties.logTemplate',
152
+ type: {
153
+ name: 'String'
154
+ }
155
+ },
133
156
  tags: {
134
157
  client_side_validation: true,
135
158
  required: false,
@@ -148,7 +148,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_06_01_preview
148
148
  response_content = http_response.body
149
149
  unless status_code == 200
150
150
  error_model = JSON.load(response_content)
151
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
151
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
152
152
  end
153
153
 
154
154
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -266,7 +266,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_06_01_preview
266
266
  response_content = http_response.body
267
267
  unless status_code == 200 || status_code == 202
268
268
  error_model = JSON.load(response_content)
269
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
269
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
270
270
  end
271
271
 
272
272
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -114,7 +114,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_06_01_preview
114
114
  response_content = http_response.body
115
115
  unless status_code == 200
116
116
  error_model = JSON.load(response_content)
117
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
117
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
118
118
  end
119
119
 
120
120
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -219,7 +219,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_06_01_preview
219
219
  response_content = http_response.body
220
220
  unless status_code == 200
221
221
  error_model = JSON.load(response_content)
222
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
222
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
223
223
  end
224
224
 
225
225
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -372,7 +372,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_06_01_preview
372
372
  response_content = http_response.body
373
373
  unless status_code == 200
374
374
  error_model = JSON.load(response_content)
375
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
375
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
376
376
  end
377
377
 
378
378
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -530,7 +530,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_06_01_preview
530
530
  response_content = http_response.body
531
531
  unless status_code == 200 || status_code == 201
532
532
  error_model = JSON.load(response_content)
533
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
533
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
534
534
  end
535
535
 
536
536
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -644,7 +644,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_06_01_preview
644
644
  response_content = http_response.body
645
645
  unless status_code == 200 || status_code == 202
646
646
  error_model = JSON.load(response_content)
647
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
647
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
648
648
  end
649
649
 
650
650
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -724,7 +724,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_06_01_preview
724
724
  response_content = http_response.body
725
725
  unless status_code == 200
726
726
  error_model = JSON.load(response_content)
727
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
727
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
728
728
  end
729
729
 
730
730
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -0,0 +1,953 @@
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::ContainerRegistry::Mgmt::V2019_06_01_preview
7
+ #
8
+ # TaskRuns
9
+ #
10
+ class TaskRuns
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the TaskRuns class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ContainerRegistryManagementClient] reference to the ContainerRegistryManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets the detailed information for a given task run.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group to which
28
+ # the container registry belongs.
29
+ # @param registry_name [String] The name of the container registry.
30
+ # @param task_run_name [String] The name of the task run.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [TaskRun] operation results.
35
+ #
36
+ def get(resource_group_name, registry_name, task_run_name, custom_headers:nil)
37
+ response = get_async(resource_group_name, registry_name, task_run_name, custom_headers:custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # Gets the detailed information for a given task run.
43
+ #
44
+ # @param resource_group_name [String] The name of the resource group to which
45
+ # the container registry belongs.
46
+ # @param registry_name [String] The name of the container registry.
47
+ # @param task_run_name [String] The name of the task run.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def get_with_http_info(resource_group_name, registry_name, task_run_name, custom_headers:nil)
54
+ get_async(resource_group_name, registry_name, task_run_name, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Gets the detailed information for a given task run.
59
+ #
60
+ # @param resource_group_name [String] The name of the resource group to which
61
+ # the container registry belongs.
62
+ # @param registry_name [String] The name of the container registry.
63
+ # @param task_run_name [String] The name of the task run.
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def get_async(resource_group_name, registry_name, task_run_name, custom_headers:nil)
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
72
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
73
+ fail ArgumentError, 'registry_name is nil' if registry_name.nil?
74
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
75
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
76
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
77
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
78
+ fail ArgumentError, 'task_run_name is nil' if task_run_name.nil?
79
+ fail ArgumentError, "'task_run_name' should satisfy the constraint - 'MaxLength': '50'" if !task_run_name.nil? && task_run_name.length > 50
80
+ fail ArgumentError, "'task_run_name' should satisfy the constraint - 'MinLength': '5'" if !task_run_name.nil? && task_run_name.length < 5
81
+ fail ArgumentError, "'task_run_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]*$'" if !task_run_name.nil? && task_run_name.match(Regexp.new('^^[a-zA-Z0-9-]*$$')).nil?
82
+
83
+
84
+ request_headers = {}
85
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
86
+
87
+ # Set Headers
88
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
89
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
90
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}'
91
+
92
+ request_url = @base_url || @client.base_url
93
+
94
+ options = {
95
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
96
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'taskRunName' => task_run_name},
97
+ query_params: {'api-version' => @client.api_version},
98
+ headers: request_headers.merge(custom_headers || {}),
99
+ base_url: request_url
100
+ }
101
+ promise = @client.make_request_async(:get, path_template, options)
102
+
103
+ promise = promise.then do |result|
104
+ http_response = result.response
105
+ status_code = http_response.status
106
+ response_content = http_response.body
107
+ unless status_code == 200
108
+ error_model = JSON.load(response_content)
109
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
110
+ end
111
+
112
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
113
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
114
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
115
+ # Deserialize Response
116
+ if status_code == 200
117
+ begin
118
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
119
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::TaskRun.mapper()
120
+ result.body = @client.deserialize(result_mapper, parsed_response)
121
+ rescue Exception => e
122
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
123
+ end
124
+ end
125
+
126
+ result
127
+ end
128
+
129
+ promise.execute
130
+ end
131
+
132
+ #
133
+ # Creates a task run for a container registry with the specified parameters.
134
+ #
135
+ # @param resource_group_name [String] The name of the resource group to which
136
+ # the container registry belongs.
137
+ # @param registry_name [String] The name of the container registry.
138
+ # @param task_run_name [String] The name of the task run.
139
+ # @param task_run [TaskRun] The parameters of a run that needs to scheduled.
140
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
141
+ # will be added to the HTTP request.
142
+ #
143
+ # @return [TaskRun] operation results.
144
+ #
145
+ def create(resource_group_name, registry_name, task_run_name, task_run, custom_headers:nil)
146
+ response = create_async(resource_group_name, registry_name, task_run_name, task_run, custom_headers:custom_headers).value!
147
+ response.body unless response.nil?
148
+ end
149
+
150
+ #
151
+ # @param resource_group_name [String] The name of the resource group to which
152
+ # the container registry belongs.
153
+ # @param registry_name [String] The name of the container registry.
154
+ # @param task_run_name [String] The name of the task run.
155
+ # @param task_run [TaskRun] The parameters of a run that needs to scheduled.
156
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
157
+ # will be added to the HTTP request.
158
+ #
159
+ # @return [Concurrent::Promise] promise which provides async access to http
160
+ # response.
161
+ #
162
+ def create_async(resource_group_name, registry_name, task_run_name, task_run, custom_headers:nil)
163
+ # Send request
164
+ promise = begin_create_async(resource_group_name, registry_name, task_run_name, task_run, custom_headers:custom_headers)
165
+
166
+ promise = promise.then do |response|
167
+ # Defining deserialization method.
168
+ deserialize_method = lambda do |parsed_response|
169
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::TaskRun.mapper()
170
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
171
+ end
172
+
173
+ # Waiting for response.
174
+ @client.get_long_running_operation_result(response, deserialize_method)
175
+ end
176
+
177
+ promise
178
+ end
179
+
180
+ #
181
+ # Deletes a specified task run resource.
182
+ #
183
+ # @param resource_group_name [String] The name of the resource group to which
184
+ # the container registry belongs.
185
+ # @param registry_name [String] The name of the container registry.
186
+ # @param task_run_name [String] The name of the task run.
187
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
188
+ # will be added to the HTTP request.
189
+ #
190
+ def delete(resource_group_name, registry_name, task_run_name, custom_headers:nil)
191
+ response = delete_async(resource_group_name, registry_name, task_run_name, custom_headers:custom_headers).value!
192
+ nil
193
+ end
194
+
195
+ #
196
+ # @param resource_group_name [String] The name of the resource group to which
197
+ # the container registry belongs.
198
+ # @param registry_name [String] The name of the container registry.
199
+ # @param task_run_name [String] The name of the task run.
200
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
201
+ # will be added to the HTTP request.
202
+ #
203
+ # @return [Concurrent::Promise] promise which provides async access to http
204
+ # response.
205
+ #
206
+ def delete_async(resource_group_name, registry_name, task_run_name, custom_headers:nil)
207
+ # Send request
208
+ promise = begin_delete_async(resource_group_name, registry_name, task_run_name, custom_headers:custom_headers)
209
+
210
+ promise = promise.then do |response|
211
+ # Defining deserialization method.
212
+ deserialize_method = lambda do |parsed_response|
213
+ end
214
+
215
+ # Waiting for response.
216
+ @client.get_long_running_operation_result(response, deserialize_method)
217
+ end
218
+
219
+ promise
220
+ end
221
+
222
+ #
223
+ # Updates a task run with the specified parameters.
224
+ #
225
+ # @param resource_group_name [String] The name of the resource group to which
226
+ # the container registry belongs.
227
+ # @param registry_name [String] The name of the container registry.
228
+ # @param task_run_name [String] The name of the task run.
229
+ # @param update_parameters [TaskRunUpdateParameters] The parameters for
230
+ # updating a task run.
231
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
232
+ # will be added to the HTTP request.
233
+ #
234
+ # @return [TaskRun] operation results.
235
+ #
236
+ def update(resource_group_name, registry_name, task_run_name, update_parameters, custom_headers:nil)
237
+ response = update_async(resource_group_name, registry_name, task_run_name, update_parameters, custom_headers:custom_headers).value!
238
+ response.body unless response.nil?
239
+ end
240
+
241
+ #
242
+ # @param resource_group_name [String] The name of the resource group to which
243
+ # the container registry belongs.
244
+ # @param registry_name [String] The name of the container registry.
245
+ # @param task_run_name [String] The name of the task run.
246
+ # @param update_parameters [TaskRunUpdateParameters] The parameters for
247
+ # updating a task run.
248
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
249
+ # will be added to the HTTP request.
250
+ #
251
+ # @return [Concurrent::Promise] promise which provides async access to http
252
+ # response.
253
+ #
254
+ def update_async(resource_group_name, registry_name, task_run_name, update_parameters, custom_headers:nil)
255
+ # Send request
256
+ promise = begin_update_async(resource_group_name, registry_name, task_run_name, update_parameters, custom_headers:custom_headers)
257
+
258
+ promise = promise.then do |response|
259
+ # Defining deserialization method.
260
+ deserialize_method = lambda do |parsed_response|
261
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::TaskRun.mapper()
262
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
263
+ end
264
+
265
+ # Waiting for response.
266
+ @client.get_long_running_operation_result(response, deserialize_method)
267
+ end
268
+
269
+ promise
270
+ end
271
+
272
+ #
273
+ # Gets the detailed information for a given task run that includes all secrets.
274
+ #
275
+ # @param resource_group_name [String] The name of the resource group to which
276
+ # the container registry belongs.
277
+ # @param registry_name [String] The name of the container registry.
278
+ # @param task_run_name [String] The name of the task run.
279
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
280
+ # will be added to the HTTP request.
281
+ #
282
+ # @return [TaskRun] operation results.
283
+ #
284
+ def get_details(resource_group_name, registry_name, task_run_name, custom_headers:nil)
285
+ response = get_details_async(resource_group_name, registry_name, task_run_name, custom_headers:custom_headers).value!
286
+ response.body unless response.nil?
287
+ end
288
+
289
+ #
290
+ # Gets the detailed information for a given task run that includes all secrets.
291
+ #
292
+ # @param resource_group_name [String] The name of the resource group to which
293
+ # the container registry belongs.
294
+ # @param registry_name [String] The name of the container registry.
295
+ # @param task_run_name [String] The name of the task run.
296
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
297
+ # will be added to the HTTP request.
298
+ #
299
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
300
+ #
301
+ def get_details_with_http_info(resource_group_name, registry_name, task_run_name, custom_headers:nil)
302
+ get_details_async(resource_group_name, registry_name, task_run_name, custom_headers:custom_headers).value!
303
+ end
304
+
305
+ #
306
+ # Gets the detailed information for a given task run that includes all secrets.
307
+ #
308
+ # @param resource_group_name [String] The name of the resource group to which
309
+ # the container registry belongs.
310
+ # @param registry_name [String] The name of the container registry.
311
+ # @param task_run_name [String] The name of the task run.
312
+ # @param [Hash{String => String}] A hash of custom headers that will be added
313
+ # to the HTTP request.
314
+ #
315
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
316
+ #
317
+ def get_details_async(resource_group_name, registry_name, task_run_name, custom_headers:nil)
318
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
319
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
320
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
321
+ fail ArgumentError, 'registry_name is nil' if registry_name.nil?
322
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
323
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
324
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
325
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
326
+ fail ArgumentError, 'task_run_name is nil' if task_run_name.nil?
327
+ fail ArgumentError, "'task_run_name' should satisfy the constraint - 'MaxLength': '50'" if !task_run_name.nil? && task_run_name.length > 50
328
+ fail ArgumentError, "'task_run_name' should satisfy the constraint - 'MinLength': '5'" if !task_run_name.nil? && task_run_name.length < 5
329
+ fail ArgumentError, "'task_run_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]*$'" if !task_run_name.nil? && task_run_name.match(Regexp.new('^^[a-zA-Z0-9-]*$$')).nil?
330
+
331
+
332
+ request_headers = {}
333
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
334
+
335
+ # Set Headers
336
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
337
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
338
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}/listDetails'
339
+
340
+ request_url = @base_url || @client.base_url
341
+
342
+ options = {
343
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
344
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'taskRunName' => task_run_name},
345
+ query_params: {'api-version' => @client.api_version},
346
+ headers: request_headers.merge(custom_headers || {}),
347
+ base_url: request_url
348
+ }
349
+ promise = @client.make_request_async(:post, path_template, options)
350
+
351
+ promise = promise.then do |result|
352
+ http_response = result.response
353
+ status_code = http_response.status
354
+ response_content = http_response.body
355
+ unless status_code == 200
356
+ error_model = JSON.load(response_content)
357
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
358
+ end
359
+
360
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
361
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
362
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
363
+ # Deserialize Response
364
+ if status_code == 200
365
+ begin
366
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
367
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::TaskRun.mapper()
368
+ result.body = @client.deserialize(result_mapper, parsed_response)
369
+ rescue Exception => e
370
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
371
+ end
372
+ end
373
+
374
+ result
375
+ end
376
+
377
+ promise.execute
378
+ end
379
+
380
+ #
381
+ # Lists all the task runs for a specified container registry.
382
+ #
383
+ # @param resource_group_name [String] The name of the resource group to which
384
+ # the container registry belongs.
385
+ # @param registry_name [String] The name of the container registry.
386
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
387
+ # will be added to the HTTP request.
388
+ #
389
+ # @return [Array<TaskRun>] operation results.
390
+ #
391
+ def list(resource_group_name, registry_name, custom_headers:nil)
392
+ first_page = list_as_lazy(resource_group_name, registry_name, custom_headers:custom_headers)
393
+ first_page.get_all_items
394
+ end
395
+
396
+ #
397
+ # Lists all the task runs for a specified container registry.
398
+ #
399
+ # @param resource_group_name [String] The name of the resource group to which
400
+ # the container registry belongs.
401
+ # @param registry_name [String] The name of the container registry.
402
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
403
+ # will be added to the HTTP request.
404
+ #
405
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
406
+ #
407
+ def list_with_http_info(resource_group_name, registry_name, custom_headers:nil)
408
+ list_async(resource_group_name, registry_name, custom_headers:custom_headers).value!
409
+ end
410
+
411
+ #
412
+ # Lists all the task runs for a specified container registry.
413
+ #
414
+ # @param resource_group_name [String] The name of the resource group to which
415
+ # the container registry belongs.
416
+ # @param registry_name [String] The name of the container registry.
417
+ # @param [Hash{String => String}] A hash of custom headers that will be added
418
+ # to the HTTP request.
419
+ #
420
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
421
+ #
422
+ def list_async(resource_group_name, registry_name, custom_headers:nil)
423
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
424
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
425
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
426
+ fail ArgumentError, 'registry_name is nil' if registry_name.nil?
427
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
428
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
429
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
430
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
431
+
432
+
433
+ request_headers = {}
434
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
435
+
436
+ # Set Headers
437
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
438
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
439
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns'
440
+
441
+ request_url = @base_url || @client.base_url
442
+
443
+ options = {
444
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
445
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name},
446
+ query_params: {'api-version' => @client.api_version},
447
+ headers: request_headers.merge(custom_headers || {}),
448
+ base_url: request_url
449
+ }
450
+ promise = @client.make_request_async(:get, path_template, options)
451
+
452
+ promise = promise.then do |result|
453
+ http_response = result.response
454
+ status_code = http_response.status
455
+ response_content = http_response.body
456
+ unless status_code == 200
457
+ error_model = JSON.load(response_content)
458
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
459
+ end
460
+
461
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
462
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
463
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
464
+ # Deserialize Response
465
+ if status_code == 200
466
+ begin
467
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
468
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::TaskRunListResult.mapper()
469
+ result.body = @client.deserialize(result_mapper, parsed_response)
470
+ rescue Exception => e
471
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
472
+ end
473
+ end
474
+
475
+ result
476
+ end
477
+
478
+ promise.execute
479
+ end
480
+
481
+ #
482
+ # Creates a task run for a container registry with the specified parameters.
483
+ #
484
+ # @param resource_group_name [String] The name of the resource group to which
485
+ # the container registry belongs.
486
+ # @param registry_name [String] The name of the container registry.
487
+ # @param task_run_name [String] The name of the task run.
488
+ # @param task_run [TaskRun] The parameters of a run that needs to scheduled.
489
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
490
+ # will be added to the HTTP request.
491
+ #
492
+ # @return [TaskRun] operation results.
493
+ #
494
+ def begin_create(resource_group_name, registry_name, task_run_name, task_run, custom_headers:nil)
495
+ response = begin_create_async(resource_group_name, registry_name, task_run_name, task_run, custom_headers:custom_headers).value!
496
+ response.body unless response.nil?
497
+ end
498
+
499
+ #
500
+ # Creates a task run for a container registry with the specified parameters.
501
+ #
502
+ # @param resource_group_name [String] The name of the resource group to which
503
+ # the container registry belongs.
504
+ # @param registry_name [String] The name of the container registry.
505
+ # @param task_run_name [String] The name of the task run.
506
+ # @param task_run [TaskRun] The parameters of a run that needs to scheduled.
507
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
508
+ # will be added to the HTTP request.
509
+ #
510
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
511
+ #
512
+ def begin_create_with_http_info(resource_group_name, registry_name, task_run_name, task_run, custom_headers:nil)
513
+ begin_create_async(resource_group_name, registry_name, task_run_name, task_run, custom_headers:custom_headers).value!
514
+ end
515
+
516
+ #
517
+ # Creates a task run for a container registry with the specified parameters.
518
+ #
519
+ # @param resource_group_name [String] The name of the resource group to which
520
+ # the container registry belongs.
521
+ # @param registry_name [String] The name of the container registry.
522
+ # @param task_run_name [String] The name of the task run.
523
+ # @param task_run [TaskRun] The parameters of a run that needs to scheduled.
524
+ # @param [Hash{String => String}] A hash of custom headers that will be added
525
+ # to the HTTP request.
526
+ #
527
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
528
+ #
529
+ def begin_create_async(resource_group_name, registry_name, task_run_name, task_run, custom_headers:nil)
530
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
531
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
532
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
533
+ fail ArgumentError, 'registry_name is nil' if registry_name.nil?
534
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
535
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
536
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
537
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
538
+ fail ArgumentError, 'task_run_name is nil' if task_run_name.nil?
539
+ fail ArgumentError, "'task_run_name' should satisfy the constraint - 'MaxLength': '50'" if !task_run_name.nil? && task_run_name.length > 50
540
+ fail ArgumentError, "'task_run_name' should satisfy the constraint - 'MinLength': '5'" if !task_run_name.nil? && task_run_name.length < 5
541
+ fail ArgumentError, "'task_run_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]*$'" if !task_run_name.nil? && task_run_name.match(Regexp.new('^^[a-zA-Z0-9-]*$$')).nil?
542
+ fail ArgumentError, 'task_run is nil' if task_run.nil?
543
+
544
+
545
+ request_headers = {}
546
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
547
+
548
+ # Set Headers
549
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
550
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
551
+
552
+ # Serialize Request
553
+ request_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::TaskRun.mapper()
554
+ request_content = @client.serialize(request_mapper, task_run)
555
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
556
+
557
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}'
558
+
559
+ request_url = @base_url || @client.base_url
560
+
561
+ options = {
562
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
563
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'taskRunName' => task_run_name},
564
+ query_params: {'api-version' => @client.api_version},
565
+ body: request_content,
566
+ headers: request_headers.merge(custom_headers || {}),
567
+ base_url: request_url
568
+ }
569
+ promise = @client.make_request_async(:put, path_template, options)
570
+
571
+ promise = promise.then do |result|
572
+ http_response = result.response
573
+ status_code = http_response.status
574
+ response_content = http_response.body
575
+ unless status_code == 200 || status_code == 201
576
+ error_model = JSON.load(response_content)
577
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
578
+ end
579
+
580
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
581
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
582
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
583
+ # Deserialize Response
584
+ if status_code == 200
585
+ begin
586
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
587
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::TaskRun.mapper()
588
+ result.body = @client.deserialize(result_mapper, parsed_response)
589
+ rescue Exception => e
590
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
591
+ end
592
+ end
593
+ # Deserialize Response
594
+ if status_code == 201
595
+ begin
596
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
597
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::TaskRun.mapper()
598
+ result.body = @client.deserialize(result_mapper, parsed_response)
599
+ rescue Exception => e
600
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
601
+ end
602
+ end
603
+
604
+ result
605
+ end
606
+
607
+ promise.execute
608
+ end
609
+
610
+ #
611
+ # Deletes a specified task run resource.
612
+ #
613
+ # @param resource_group_name [String] The name of the resource group to which
614
+ # the container registry belongs.
615
+ # @param registry_name [String] The name of the container registry.
616
+ # @param task_run_name [String] The name of the task run.
617
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
618
+ # will be added to the HTTP request.
619
+ #
620
+ #
621
+ def begin_delete(resource_group_name, registry_name, task_run_name, custom_headers:nil)
622
+ response = begin_delete_async(resource_group_name, registry_name, task_run_name, custom_headers:custom_headers).value!
623
+ nil
624
+ end
625
+
626
+ #
627
+ # Deletes a specified task run resource.
628
+ #
629
+ # @param resource_group_name [String] The name of the resource group to which
630
+ # the container registry belongs.
631
+ # @param registry_name [String] The name of the container registry.
632
+ # @param task_run_name [String] The name of the task run.
633
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
634
+ # will be added to the HTTP request.
635
+ #
636
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
637
+ #
638
+ def begin_delete_with_http_info(resource_group_name, registry_name, task_run_name, custom_headers:nil)
639
+ begin_delete_async(resource_group_name, registry_name, task_run_name, custom_headers:custom_headers).value!
640
+ end
641
+
642
+ #
643
+ # Deletes a specified task run resource.
644
+ #
645
+ # @param resource_group_name [String] The name of the resource group to which
646
+ # the container registry belongs.
647
+ # @param registry_name [String] The name of the container registry.
648
+ # @param task_run_name [String] The name of the task run.
649
+ # @param [Hash{String => String}] A hash of custom headers that will be added
650
+ # to the HTTP request.
651
+ #
652
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
653
+ #
654
+ def begin_delete_async(resource_group_name, registry_name, task_run_name, custom_headers:nil)
655
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
656
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
657
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
658
+ fail ArgumentError, 'registry_name is nil' if registry_name.nil?
659
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
660
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
661
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
662
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
663
+ fail ArgumentError, 'task_run_name is nil' if task_run_name.nil?
664
+ fail ArgumentError, "'task_run_name' should satisfy the constraint - 'MaxLength': '50'" if !task_run_name.nil? && task_run_name.length > 50
665
+ fail ArgumentError, "'task_run_name' should satisfy the constraint - 'MinLength': '5'" if !task_run_name.nil? && task_run_name.length < 5
666
+ fail ArgumentError, "'task_run_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]*$'" if !task_run_name.nil? && task_run_name.match(Regexp.new('^^[a-zA-Z0-9-]*$$')).nil?
667
+
668
+
669
+ request_headers = {}
670
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
671
+
672
+ # Set Headers
673
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
674
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
675
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}'
676
+
677
+ request_url = @base_url || @client.base_url
678
+
679
+ options = {
680
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
681
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'taskRunName' => task_run_name},
682
+ query_params: {'api-version' => @client.api_version},
683
+ headers: request_headers.merge(custom_headers || {}),
684
+ base_url: request_url
685
+ }
686
+ promise = @client.make_request_async(:delete, path_template, options)
687
+
688
+ promise = promise.then do |result|
689
+ http_response = result.response
690
+ status_code = http_response.status
691
+ response_content = http_response.body
692
+ unless status_code == 200 || status_code == 202 || status_code == 204
693
+ error_model = JSON.load(response_content)
694
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
695
+ end
696
+
697
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
698
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
699
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
700
+
701
+ result
702
+ end
703
+
704
+ promise.execute
705
+ end
706
+
707
+ #
708
+ # Updates a task run with the specified parameters.
709
+ #
710
+ # @param resource_group_name [String] The name of the resource group to which
711
+ # the container registry belongs.
712
+ # @param registry_name [String] The name of the container registry.
713
+ # @param task_run_name [String] The name of the task run.
714
+ # @param update_parameters [TaskRunUpdateParameters] The parameters for
715
+ # updating a task run.
716
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
717
+ # will be added to the HTTP request.
718
+ #
719
+ # @return [TaskRun] operation results.
720
+ #
721
+ def begin_update(resource_group_name, registry_name, task_run_name, update_parameters, custom_headers:nil)
722
+ response = begin_update_async(resource_group_name, registry_name, task_run_name, update_parameters, custom_headers:custom_headers).value!
723
+ response.body unless response.nil?
724
+ end
725
+
726
+ #
727
+ # Updates a task run with the specified parameters.
728
+ #
729
+ # @param resource_group_name [String] The name of the resource group to which
730
+ # the container registry belongs.
731
+ # @param registry_name [String] The name of the container registry.
732
+ # @param task_run_name [String] The name of the task run.
733
+ # @param update_parameters [TaskRunUpdateParameters] The parameters for
734
+ # updating a task run.
735
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
736
+ # will be added to the HTTP request.
737
+ #
738
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
739
+ #
740
+ def begin_update_with_http_info(resource_group_name, registry_name, task_run_name, update_parameters, custom_headers:nil)
741
+ begin_update_async(resource_group_name, registry_name, task_run_name, update_parameters, custom_headers:custom_headers).value!
742
+ end
743
+
744
+ #
745
+ # Updates a task run with the specified parameters.
746
+ #
747
+ # @param resource_group_name [String] The name of the resource group to which
748
+ # the container registry belongs.
749
+ # @param registry_name [String] The name of the container registry.
750
+ # @param task_run_name [String] The name of the task run.
751
+ # @param update_parameters [TaskRunUpdateParameters] The parameters for
752
+ # updating a task run.
753
+ # @param [Hash{String => String}] A hash of custom headers that will be added
754
+ # to the HTTP request.
755
+ #
756
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
757
+ #
758
+ def begin_update_async(resource_group_name, registry_name, task_run_name, update_parameters, custom_headers:nil)
759
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
760
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
761
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
762
+ fail ArgumentError, 'registry_name is nil' if registry_name.nil?
763
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
764
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
765
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
766
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
767
+ fail ArgumentError, 'task_run_name is nil' if task_run_name.nil?
768
+ fail ArgumentError, "'task_run_name' should satisfy the constraint - 'MaxLength': '50'" if !task_run_name.nil? && task_run_name.length > 50
769
+ fail ArgumentError, "'task_run_name' should satisfy the constraint - 'MinLength': '5'" if !task_run_name.nil? && task_run_name.length < 5
770
+ fail ArgumentError, "'task_run_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]*$'" if !task_run_name.nil? && task_run_name.match(Regexp.new('^^[a-zA-Z0-9-]*$$')).nil?
771
+ fail ArgumentError, 'update_parameters is nil' if update_parameters.nil?
772
+
773
+
774
+ request_headers = {}
775
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
776
+
777
+ # Set Headers
778
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
779
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
780
+
781
+ # Serialize Request
782
+ request_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::TaskRunUpdateParameters.mapper()
783
+ request_content = @client.serialize(request_mapper, update_parameters)
784
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
785
+
786
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}'
787
+
788
+ request_url = @base_url || @client.base_url
789
+
790
+ options = {
791
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
792
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'taskRunName' => task_run_name},
793
+ query_params: {'api-version' => @client.api_version},
794
+ body: request_content,
795
+ headers: request_headers.merge(custom_headers || {}),
796
+ base_url: request_url
797
+ }
798
+ promise = @client.make_request_async(:patch, path_template, options)
799
+
800
+ promise = promise.then do |result|
801
+ http_response = result.response
802
+ status_code = http_response.status
803
+ response_content = http_response.body
804
+ unless status_code == 200 || status_code == 201
805
+ error_model = JSON.load(response_content)
806
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
807
+ end
808
+
809
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
810
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
811
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
812
+ # Deserialize Response
813
+ if status_code == 200
814
+ begin
815
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
816
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::TaskRun.mapper()
817
+ result.body = @client.deserialize(result_mapper, parsed_response)
818
+ rescue Exception => e
819
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
820
+ end
821
+ end
822
+ # Deserialize Response
823
+ if status_code == 201
824
+ begin
825
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
826
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::TaskRun.mapper()
827
+ result.body = @client.deserialize(result_mapper, parsed_response)
828
+ rescue Exception => e
829
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
830
+ end
831
+ end
832
+
833
+ result
834
+ end
835
+
836
+ promise.execute
837
+ end
838
+
839
+ #
840
+ # Lists all the task runs for a specified container registry.
841
+ #
842
+ # @param next_page_link [String] The NextLink from the previous successful call
843
+ # to List operation.
844
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
845
+ # will be added to the HTTP request.
846
+ #
847
+ # @return [TaskRunListResult] operation results.
848
+ #
849
+ def list_next(next_page_link, custom_headers:nil)
850
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
851
+ response.body unless response.nil?
852
+ end
853
+
854
+ #
855
+ # Lists all the task runs for a specified container registry.
856
+ #
857
+ # @param next_page_link [String] The NextLink from the previous successful call
858
+ # to List operation.
859
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
860
+ # will be added to the HTTP request.
861
+ #
862
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
863
+ #
864
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
865
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
866
+ end
867
+
868
+ #
869
+ # Lists all the task runs for a specified container registry.
870
+ #
871
+ # @param next_page_link [String] The NextLink from the previous successful call
872
+ # to List operation.
873
+ # @param [Hash{String => String}] A hash of custom headers that will be added
874
+ # to the HTTP request.
875
+ #
876
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
877
+ #
878
+ def list_next_async(next_page_link, custom_headers:nil)
879
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
880
+
881
+
882
+ request_headers = {}
883
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
884
+
885
+ # Set Headers
886
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
887
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
888
+ path_template = '{nextLink}'
889
+
890
+ request_url = @base_url || @client.base_url
891
+
892
+ options = {
893
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
894
+ skip_encoding_path_params: {'nextLink' => next_page_link},
895
+ headers: request_headers.merge(custom_headers || {}),
896
+ base_url: request_url
897
+ }
898
+ promise = @client.make_request_async(:get, path_template, options)
899
+
900
+ promise = promise.then do |result|
901
+ http_response = result.response
902
+ status_code = http_response.status
903
+ response_content = http_response.body
904
+ unless status_code == 200
905
+ error_model = JSON.load(response_content)
906
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
907
+ end
908
+
909
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
910
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
911
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
912
+ # Deserialize Response
913
+ if status_code == 200
914
+ begin
915
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
916
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::TaskRunListResult.mapper()
917
+ result.body = @client.deserialize(result_mapper, parsed_response)
918
+ rescue Exception => e
919
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
920
+ end
921
+ end
922
+
923
+ result
924
+ end
925
+
926
+ promise.execute
927
+ end
928
+
929
+ #
930
+ # Lists all the task runs for a specified container registry.
931
+ #
932
+ # @param resource_group_name [String] The name of the resource group to which
933
+ # the container registry belongs.
934
+ # @param registry_name [String] The name of the container registry.
935
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
936
+ # will be added to the HTTP request.
937
+ #
938
+ # @return [TaskRunListResult] which provide lazy access to pages of the
939
+ # response.
940
+ #
941
+ def list_as_lazy(resource_group_name, registry_name, custom_headers:nil)
942
+ response = list_async(resource_group_name, registry_name, custom_headers:custom_headers).value!
943
+ unless response.nil?
944
+ page = response.body
945
+ page.next_method = Proc.new do |next_page_link|
946
+ list_next_async(next_page_link, custom_headers:custom_headers)
947
+ end
948
+ page
949
+ end
950
+ end
951
+
952
+ end
953
+ end