azure_mgmt_container_registry 0.17.1 → 0.17.2

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 (132) 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-03-01/generated/azure_mgmt_container_registry/registries.rb +7 -0
  5. data/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  6. data/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/models/target.rb +1 -1
  7. data/lib/2017-10-01/generated/azure_mgmt_container_registry.rb +15 -11
  8. data/lib/2017-10-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  9. data/lib/2017-10-01/generated/azure_mgmt_container_registry/models/default_action.rb +16 -0
  10. data/lib/2017-10-01/generated/azure_mgmt_container_registry/models/import_source.rb +27 -2
  11. data/lib/2017-10-01/generated/azure_mgmt_container_registry/models/import_source_credentials.rb +59 -0
  12. data/lib/2017-10-01/generated/azure_mgmt_container_registry/models/network_rule_set.rb +69 -0
  13. data/lib/2017-10-01/generated/azure_mgmt_container_registry/models/registry.rb +12 -0
  14. data/lib/2017-10-01/generated/azure_mgmt_container_registry/models/registry_update_parameters.rb +12 -0
  15. data/lib/2017-10-01/generated/azure_mgmt_container_registry/models/virtual_network_rule.rb +47 -0
  16. data/lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb +11 -0
  17. data/lib/2017-10-01/generated/azure_mgmt_container_registry/replications.rb +5 -0
  18. data/lib/2017-10-01/generated/azure_mgmt_container_registry/webhooks.rb +8 -0
  19. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry.rb +72 -0
  20. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/build_steps.rb +1147 -0
  21. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/build_tasks.rb +971 -0
  22. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb +766 -0
  23. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +143 -0
  24. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/base_image_dependency.rb +91 -0
  25. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/base_image_dependency_type.rb +16 -0
  26. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/base_image_trigger_type.rb +17 -0
  27. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build.rb +239 -0
  28. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_argument.rb +84 -0
  29. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_argument_list.rb +99 -0
  30. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_filter.rb +129 -0
  31. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_get_log_result.rb +46 -0
  32. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_list_result.rb +99 -0
  33. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_status.rb +22 -0
  34. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_step.rb +76 -0
  35. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_step_list.rb +99 -0
  36. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_step_properties.rb +60 -0
  37. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_step_properties_update_parameters.rb +46 -0
  38. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_step_update_parameters.rb +69 -0
  39. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_task.rb +178 -0
  40. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_task_build_request.rb +62 -0
  41. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_task_filter.rb +46 -0
  42. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_task_list_result.rb +99 -0
  43. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_task_status.rb +16 -0
  44. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_task_update_parameters.rb +118 -0
  45. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_type.rb +16 -0
  46. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_update_parameters.rb +47 -0
  47. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/docker_build_step.rb +197 -0
  48. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/docker_build_step_update_parameters.rb +163 -0
  49. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/git_commit_trigger.rb +90 -0
  50. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/image_descriptor.rb +79 -0
  51. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/image_update_trigger.rb +78 -0
  52. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/os_type.rb +16 -0
  53. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/platform_properties.rb +59 -0
  54. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/provisioning_state.rb +20 -0
  55. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/proxy_resource.rb +72 -0
  56. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/queue_build_request.rb +47 -0
  57. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/quick_build_request.rb +173 -0
  58. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/resource.rb +111 -0
  59. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/source_control_auth_info.rb +92 -0
  60. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/source_control_type.rb +16 -0
  61. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/source_repository_properties.rb +84 -0
  62. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/source_repository_update_parameters.rb +60 -0
  63. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/source_upload_definition.rb +58 -0
  64. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/token_type.rb +16 -0
  65. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/module_definition.rb +9 -0
  66. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/registries.rb +287 -0
  67. data/lib/2018-09-01/generated/azure_mgmt_container_registry.rb +86 -0
  68. data/lib/2018-09-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +139 -0
  69. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/agent_properties.rb +47 -0
  70. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/architecture.rb +17 -0
  71. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/argument.rb +70 -0
  72. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/auth_info.rb +92 -0
  73. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/auth_info_update_parameters.rb +92 -0
  74. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/base_image_dependency.rb +91 -0
  75. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/base_image_dependency_type.rb +16 -0
  76. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/base_image_trigger.rb +70 -0
  77. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/base_image_trigger_type.rb +16 -0
  78. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/base_image_trigger_update_parameters.rb +70 -0
  79. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/docker_build_request.rb +193 -0
  80. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/docker_build_step.rb +163 -0
  81. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/docker_build_step_update_parameters.rb +142 -0
  82. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/encoded_task_run_request.rb +159 -0
  83. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/encoded_task_step.rb +129 -0
  84. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/encoded_task_step_update_parameters.rb +111 -0
  85. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/file_task_run_request.rb +159 -0
  86. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/file_task_step.rb +129 -0
  87. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/file_task_step_update_parameters.rb +111 -0
  88. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/image_descriptor.rb +79 -0
  89. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/image_update_trigger.rb +78 -0
  90. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/os.rb +16 -0
  91. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/platform_properties.rb +71 -0
  92. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/platform_update_parameters.rb +71 -0
  93. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/provisioning_state.rb +20 -0
  94. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/proxy_resource.rb +72 -0
  95. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/resource.rb +111 -0
  96. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/run.rb +252 -0
  97. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/run_filter.rb +129 -0
  98. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/run_get_log_result.rb +47 -0
  99. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/run_list_result.rb +99 -0
  100. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/run_request.rb +62 -0
  101. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/run_status.rb +22 -0
  102. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/run_type.rb +18 -0
  103. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/run_update_parameters.rb +47 -0
  104. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/set_value.rb +71 -0
  105. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_control_type.rb +16 -0
  106. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_properties.rb +83 -0
  107. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_trigger.rb +91 -0
  108. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_trigger_descriptor.rb +112 -0
  109. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_trigger_event.rb +16 -0
  110. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_trigger_update_parameters.rb +91 -0
  111. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_update_parameters.rb +83 -0
  112. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_upload_definition.rb +58 -0
  113. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/task.rb +193 -0
  114. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/task_list_result.rb +99 -0
  115. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/task_run_request.rb +91 -0
  116. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/task_status.rb +16 -0
  117. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/task_step_properties.rb +94 -0
  118. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/task_step_update_parameters.rb +72 -0
  119. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/task_update_parameters.rb +130 -0
  120. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/token_type.rb +16 -0
  121. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/trigger_properties.rb +69 -0
  122. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/trigger_status.rb +16 -0
  123. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/trigger_update_parameters.rb +69 -0
  124. data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/variant.rb +17 -0
  125. data/lib/2018-09-01/generated/azure_mgmt_container_registry/module_definition.rb +9 -0
  126. data/lib/2018-09-01/generated/azure_mgmt_container_registry/registries.rb +289 -0
  127. data/lib/2018-09-01/generated/azure_mgmt_container_registry/runs.rb +766 -0
  128. data/lib/2018-09-01/generated/azure_mgmt_container_registry/tasks.rb +938 -0
  129. data/lib/azure_mgmt_container_registry.rb +2 -0
  130. data/lib/profiles/latest/modules/containerregistry_profile_module.rb +288 -44
  131. data/lib/version.rb +1 -1
  132. metadata +116 -2
@@ -0,0 +1,766 @@
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::V2018_02_01_preview
7
+ #
8
+ # Builds
9
+ #
10
+ class Builds
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Builds 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 all the builds for a registry.
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 filter [String] The builds filter to apply on the operation.
31
+ # @param top [Integer] $top is supported for get list of builds, which limits
32
+ # the maximum number of builds to return.
33
+ # @param skip_token [String] $skipToken is supported on get list of builds,
34
+ # which provides the next page in the list of builds.
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ # @return [Array<Build>] operation results.
39
+ #
40
+ def list(resource_group_name, registry_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
41
+ first_page = list_as_lazy(resource_group_name, registry_name, filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers)
42
+ first_page.get_all_items
43
+ end
44
+
45
+ #
46
+ # Gets all the builds for a registry.
47
+ #
48
+ # @param resource_group_name [String] The name of the resource group to which
49
+ # the container registry belongs.
50
+ # @param registry_name [String] The name of the container registry.
51
+ # @param filter [String] The builds filter to apply on the operation.
52
+ # @param top [Integer] $top is supported for get list of builds, which limits
53
+ # the maximum number of builds to return.
54
+ # @param skip_token [String] $skipToken is supported on get list of builds,
55
+ # which provides the next page in the list of builds.
56
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
57
+ # will be added to the HTTP request.
58
+ #
59
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
60
+ #
61
+ def list_with_http_info(resource_group_name, registry_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
62
+ list_async(resource_group_name, registry_name, filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers).value!
63
+ end
64
+
65
+ #
66
+ # Gets all the builds for a registry.
67
+ #
68
+ # @param resource_group_name [String] The name of the resource group to which
69
+ # the container registry belongs.
70
+ # @param registry_name [String] The name of the container registry.
71
+ # @param filter [String] The builds filter to apply on the operation.
72
+ # @param top [Integer] $top is supported for get list of builds, which limits
73
+ # the maximum number of builds to return.
74
+ # @param skip_token [String] $skipToken is supported on get list of builds,
75
+ # which provides the next page in the list of builds.
76
+ # @param [Hash{String => String}] A hash of custom headers that will be added
77
+ # to the HTTP request.
78
+ #
79
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
80
+ #
81
+ def list_async(resource_group_name, registry_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
82
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
83
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
84
+ fail ArgumentError, 'registry_name is nil' if registry_name.nil?
85
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
86
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
87
+ 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?
88
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
89
+
90
+
91
+ request_headers = {}
92
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
93
+
94
+ # Set Headers
95
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
96
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
97
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds'
98
+
99
+ request_url = @base_url || @client.base_url
100
+
101
+ options = {
102
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
103
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name},
104
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skipToken' => skip_token},
105
+ headers: request_headers.merge(custom_headers || {}),
106
+ base_url: request_url
107
+ }
108
+ promise = @client.make_request_async(:get, path_template, options)
109
+
110
+ promise = promise.then do |result|
111
+ http_response = result.response
112
+ status_code = http_response.status
113
+ response_content = http_response.body
114
+ unless status_code == 200
115
+ error_model = JSON.load(response_content)
116
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
117
+ end
118
+
119
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
120
+ # Deserialize Response
121
+ if status_code == 200
122
+ begin
123
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
124
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildListResult.mapper()
125
+ result.body = @client.deserialize(result_mapper, parsed_response)
126
+ rescue Exception => e
127
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
128
+ end
129
+ end
130
+
131
+ result
132
+ end
133
+
134
+ promise.execute
135
+ end
136
+
137
+ #
138
+ # Gets the detailed information for a given build.
139
+ #
140
+ # @param resource_group_name [String] The name of the resource group to which
141
+ # the container registry belongs.
142
+ # @param registry_name [String] The name of the container registry.
143
+ # @param build_id [String] The build ID.
144
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
145
+ # will be added to the HTTP request.
146
+ #
147
+ # @return [Build] operation results.
148
+ #
149
+ def get(resource_group_name, registry_name, build_id, custom_headers:nil)
150
+ response = get_async(resource_group_name, registry_name, build_id, custom_headers:custom_headers).value!
151
+ response.body unless response.nil?
152
+ end
153
+
154
+ #
155
+ # Gets the detailed information for a given build.
156
+ #
157
+ # @param resource_group_name [String] The name of the resource group to which
158
+ # the container registry belongs.
159
+ # @param registry_name [String] The name of the container registry.
160
+ # @param build_id [String] The build ID.
161
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
162
+ # will be added to the HTTP request.
163
+ #
164
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
165
+ #
166
+ def get_with_http_info(resource_group_name, registry_name, build_id, custom_headers:nil)
167
+ get_async(resource_group_name, registry_name, build_id, custom_headers:custom_headers).value!
168
+ end
169
+
170
+ #
171
+ # Gets the detailed information for a given build.
172
+ #
173
+ # @param resource_group_name [String] The name of the resource group to which
174
+ # the container registry belongs.
175
+ # @param registry_name [String] The name of the container registry.
176
+ # @param build_id [String] The build ID.
177
+ # @param [Hash{String => String}] A hash of custom headers that will be added
178
+ # to the HTTP request.
179
+ #
180
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
181
+ #
182
+ def get_async(resource_group_name, registry_name, build_id, custom_headers:nil)
183
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
184
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
185
+ fail ArgumentError, 'registry_name is nil' if registry_name.nil?
186
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
187
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
188
+ 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?
189
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
190
+ fail ArgumentError, 'build_id is nil' if build_id.nil?
191
+
192
+
193
+ request_headers = {}
194
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
195
+
196
+ # Set Headers
197
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
198
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
199
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds/{buildId}'
200
+
201
+ request_url = @base_url || @client.base_url
202
+
203
+ options = {
204
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
205
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'buildId' => build_id},
206
+ query_params: {'api-version' => @client.api_version},
207
+ headers: request_headers.merge(custom_headers || {}),
208
+ base_url: request_url
209
+ }
210
+ promise = @client.make_request_async(:get, path_template, options)
211
+
212
+ promise = promise.then do |result|
213
+ http_response = result.response
214
+ status_code = http_response.status
215
+ response_content = http_response.body
216
+ unless status_code == 200
217
+ error_model = JSON.load(response_content)
218
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
219
+ end
220
+
221
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
222
+ # Deserialize Response
223
+ if status_code == 200
224
+ begin
225
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
226
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::Build.mapper()
227
+ result.body = @client.deserialize(result_mapper, parsed_response)
228
+ rescue Exception => e
229
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
230
+ end
231
+ end
232
+
233
+ result
234
+ end
235
+
236
+ promise.execute
237
+ end
238
+
239
+ #
240
+ # Patch the build properties.
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 build_id [String] The build ID.
246
+ # @param build_update_parameters [BuildUpdateParameters] The build update
247
+ # properties.
248
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
249
+ # will be added to the HTTP request.
250
+ #
251
+ # @return [Build] operation results.
252
+ #
253
+ def update(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:nil)
254
+ response = update_async(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:custom_headers).value!
255
+ response.body unless response.nil?
256
+ end
257
+
258
+ #
259
+ # @param resource_group_name [String] The name of the resource group to which
260
+ # the container registry belongs.
261
+ # @param registry_name [String] The name of the container registry.
262
+ # @param build_id [String] The build ID.
263
+ # @param build_update_parameters [BuildUpdateParameters] The build update
264
+ # properties.
265
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
266
+ # will be added to the HTTP request.
267
+ #
268
+ # @return [Concurrent::Promise] promise which provides async access to http
269
+ # response.
270
+ #
271
+ def update_async(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:nil)
272
+ # Send request
273
+ promise = begin_update_async(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:custom_headers)
274
+
275
+ promise = promise.then do |response|
276
+ # Defining deserialization method.
277
+ deserialize_method = lambda do |parsed_response|
278
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::Build.mapper()
279
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
280
+ end
281
+
282
+ # Waiting for response.
283
+ @client.get_long_running_operation_result(response, deserialize_method)
284
+ end
285
+
286
+ promise
287
+ end
288
+
289
+ #
290
+ # Gets a link to download the build logs.
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 build_id [String] The build ID.
296
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
297
+ # will be added to the HTTP request.
298
+ #
299
+ # @return [BuildGetLogResult] operation results.
300
+ #
301
+ def get_log_link(resource_group_name, registry_name, build_id, custom_headers:nil)
302
+ response = get_log_link_async(resource_group_name, registry_name, build_id, custom_headers:custom_headers).value!
303
+ response.body unless response.nil?
304
+ end
305
+
306
+ #
307
+ # Gets a link to download the build logs.
308
+ #
309
+ # @param resource_group_name [String] The name of the resource group to which
310
+ # the container registry belongs.
311
+ # @param registry_name [String] The name of the container registry.
312
+ # @param build_id [String] The build ID.
313
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
314
+ # will be added to the HTTP request.
315
+ #
316
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
317
+ #
318
+ def get_log_link_with_http_info(resource_group_name, registry_name, build_id, custom_headers:nil)
319
+ get_log_link_async(resource_group_name, registry_name, build_id, custom_headers:custom_headers).value!
320
+ end
321
+
322
+ #
323
+ # Gets a link to download the build logs.
324
+ #
325
+ # @param resource_group_name [String] The name of the resource group to which
326
+ # the container registry belongs.
327
+ # @param registry_name [String] The name of the container registry.
328
+ # @param build_id [String] The build ID.
329
+ # @param [Hash{String => String}] A hash of custom headers that will be added
330
+ # to the HTTP request.
331
+ #
332
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
333
+ #
334
+ def get_log_link_async(resource_group_name, registry_name, build_id, custom_headers:nil)
335
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
336
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
337
+ fail ArgumentError, 'registry_name is nil' if registry_name.nil?
338
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
339
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
340
+ 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?
341
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
342
+ fail ArgumentError, 'build_id is nil' if build_id.nil?
343
+
344
+
345
+ request_headers = {}
346
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
347
+
348
+ # Set Headers
349
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
350
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
351
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds/{buildId}/getLogLink'
352
+
353
+ request_url = @base_url || @client.base_url
354
+
355
+ options = {
356
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
357
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'buildId' => build_id},
358
+ query_params: {'api-version' => @client.api_version},
359
+ headers: request_headers.merge(custom_headers || {}),
360
+ base_url: request_url
361
+ }
362
+ promise = @client.make_request_async(:post, path_template, options)
363
+
364
+ promise = promise.then do |result|
365
+ http_response = result.response
366
+ status_code = http_response.status
367
+ response_content = http_response.body
368
+ unless status_code == 200
369
+ error_model = JSON.load(response_content)
370
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
371
+ end
372
+
373
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
374
+ # Deserialize Response
375
+ if status_code == 200
376
+ begin
377
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
378
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildGetLogResult.mapper()
379
+ result.body = @client.deserialize(result_mapper, parsed_response)
380
+ rescue Exception => e
381
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
382
+ end
383
+ end
384
+
385
+ result
386
+ end
387
+
388
+ promise.execute
389
+ end
390
+
391
+ #
392
+ # Cancel an existing build.
393
+ #
394
+ # @param resource_group_name [String] The name of the resource group to which
395
+ # the container registry belongs.
396
+ # @param registry_name [String] The name of the container registry.
397
+ # @param build_id [String] The build ID.
398
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
399
+ # will be added to the HTTP request.
400
+ #
401
+ def cancel(resource_group_name, registry_name, build_id, custom_headers:nil)
402
+ response = cancel_async(resource_group_name, registry_name, build_id, custom_headers:custom_headers).value!
403
+ nil
404
+ end
405
+
406
+ #
407
+ # @param resource_group_name [String] The name of the resource group to which
408
+ # the container registry belongs.
409
+ # @param registry_name [String] The name of the container registry.
410
+ # @param build_id [String] The build ID.
411
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
412
+ # will be added to the HTTP request.
413
+ #
414
+ # @return [Concurrent::Promise] promise which provides async access to http
415
+ # response.
416
+ #
417
+ def cancel_async(resource_group_name, registry_name, build_id, custom_headers:nil)
418
+ # Send request
419
+ promise = begin_cancel_async(resource_group_name, registry_name, build_id, custom_headers:custom_headers)
420
+
421
+ promise = promise.then do |response|
422
+ # Defining deserialization method.
423
+ deserialize_method = lambda do |parsed_response|
424
+ end
425
+
426
+ # Waiting for response.
427
+ @client.get_long_running_operation_result(response, deserialize_method)
428
+ end
429
+
430
+ promise
431
+ end
432
+
433
+ #
434
+ # Patch the build properties.
435
+ #
436
+ # @param resource_group_name [String] The name of the resource group to which
437
+ # the container registry belongs.
438
+ # @param registry_name [String] The name of the container registry.
439
+ # @param build_id [String] The build ID.
440
+ # @param build_update_parameters [BuildUpdateParameters] The build update
441
+ # properties.
442
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
443
+ # will be added to the HTTP request.
444
+ #
445
+ # @return [Build] operation results.
446
+ #
447
+ def begin_update(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:nil)
448
+ response = begin_update_async(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:custom_headers).value!
449
+ response.body unless response.nil?
450
+ end
451
+
452
+ #
453
+ # Patch the build properties.
454
+ #
455
+ # @param resource_group_name [String] The name of the resource group to which
456
+ # the container registry belongs.
457
+ # @param registry_name [String] The name of the container registry.
458
+ # @param build_id [String] The build ID.
459
+ # @param build_update_parameters [BuildUpdateParameters] The build update
460
+ # properties.
461
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
462
+ # will be added to the HTTP request.
463
+ #
464
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
465
+ #
466
+ def begin_update_with_http_info(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:nil)
467
+ begin_update_async(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:custom_headers).value!
468
+ end
469
+
470
+ #
471
+ # Patch the build properties.
472
+ #
473
+ # @param resource_group_name [String] The name of the resource group to which
474
+ # the container registry belongs.
475
+ # @param registry_name [String] The name of the container registry.
476
+ # @param build_id [String] The build ID.
477
+ # @param build_update_parameters [BuildUpdateParameters] The build update
478
+ # properties.
479
+ # @param [Hash{String => String}] A hash of custom headers that will be added
480
+ # to the HTTP request.
481
+ #
482
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
483
+ #
484
+ def begin_update_async(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:nil)
485
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
486
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
487
+ fail ArgumentError, 'registry_name is nil' if registry_name.nil?
488
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
489
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
490
+ 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?
491
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
492
+ fail ArgumentError, 'build_id is nil' if build_id.nil?
493
+ fail ArgumentError, 'build_update_parameters is nil' if build_update_parameters.nil?
494
+
495
+
496
+ request_headers = {}
497
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
498
+
499
+ # Set Headers
500
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
501
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
502
+
503
+ # Serialize Request
504
+ request_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildUpdateParameters.mapper()
505
+ request_content = @client.serialize(request_mapper, build_update_parameters)
506
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
507
+
508
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds/{buildId}'
509
+
510
+ request_url = @base_url || @client.base_url
511
+
512
+ options = {
513
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
514
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'buildId' => build_id},
515
+ query_params: {'api-version' => @client.api_version},
516
+ body: request_content,
517
+ headers: request_headers.merge(custom_headers || {}),
518
+ base_url: request_url
519
+ }
520
+ promise = @client.make_request_async(:patch, path_template, options)
521
+
522
+ promise = promise.then do |result|
523
+ http_response = result.response
524
+ status_code = http_response.status
525
+ response_content = http_response.body
526
+ unless status_code == 200 || status_code == 201
527
+ error_model = JSON.load(response_content)
528
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
529
+ end
530
+
531
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
532
+ # Deserialize Response
533
+ if status_code == 200
534
+ begin
535
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
536
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::Build.mapper()
537
+ result.body = @client.deserialize(result_mapper, parsed_response)
538
+ rescue Exception => e
539
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
540
+ end
541
+ end
542
+ # Deserialize Response
543
+ if status_code == 201
544
+ begin
545
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
546
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::Build.mapper()
547
+ result.body = @client.deserialize(result_mapper, parsed_response)
548
+ rescue Exception => e
549
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
550
+ end
551
+ end
552
+
553
+ result
554
+ end
555
+
556
+ promise.execute
557
+ end
558
+
559
+ #
560
+ # Cancel an existing build.
561
+ #
562
+ # @param resource_group_name [String] The name of the resource group to which
563
+ # the container registry belongs.
564
+ # @param registry_name [String] The name of the container registry.
565
+ # @param build_id [String] The build ID.
566
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
567
+ # will be added to the HTTP request.
568
+ #
569
+ #
570
+ def begin_cancel(resource_group_name, registry_name, build_id, custom_headers:nil)
571
+ response = begin_cancel_async(resource_group_name, registry_name, build_id, custom_headers:custom_headers).value!
572
+ nil
573
+ end
574
+
575
+ #
576
+ # Cancel an existing build.
577
+ #
578
+ # @param resource_group_name [String] The name of the resource group to which
579
+ # the container registry belongs.
580
+ # @param registry_name [String] The name of the container registry.
581
+ # @param build_id [String] The build ID.
582
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
583
+ # will be added to the HTTP request.
584
+ #
585
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
586
+ #
587
+ def begin_cancel_with_http_info(resource_group_name, registry_name, build_id, custom_headers:nil)
588
+ begin_cancel_async(resource_group_name, registry_name, build_id, custom_headers:custom_headers).value!
589
+ end
590
+
591
+ #
592
+ # Cancel an existing build.
593
+ #
594
+ # @param resource_group_name [String] The name of the resource group to which
595
+ # the container registry belongs.
596
+ # @param registry_name [String] The name of the container registry.
597
+ # @param build_id [String] The build ID.
598
+ # @param [Hash{String => String}] A hash of custom headers that will be added
599
+ # to the HTTP request.
600
+ #
601
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
602
+ #
603
+ def begin_cancel_async(resource_group_name, registry_name, build_id, custom_headers:nil)
604
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
605
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
606
+ fail ArgumentError, 'registry_name is nil' if registry_name.nil?
607
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
608
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
609
+ 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?
610
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
611
+ fail ArgumentError, 'build_id is nil' if build_id.nil?
612
+
613
+
614
+ request_headers = {}
615
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
616
+
617
+ # Set Headers
618
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
619
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
620
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds/{buildId}/cancel'
621
+
622
+ request_url = @base_url || @client.base_url
623
+
624
+ options = {
625
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
626
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'buildId' => build_id},
627
+ query_params: {'api-version' => @client.api_version},
628
+ headers: request_headers.merge(custom_headers || {}),
629
+ base_url: request_url
630
+ }
631
+ promise = @client.make_request_async(:post, path_template, options)
632
+
633
+ promise = promise.then do |result|
634
+ http_response = result.response
635
+ status_code = http_response.status
636
+ response_content = http_response.body
637
+ unless status_code == 200 || status_code == 202
638
+ error_model = JSON.load(response_content)
639
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
640
+ end
641
+
642
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
643
+
644
+ result
645
+ end
646
+
647
+ promise.execute
648
+ end
649
+
650
+ #
651
+ # Gets all the builds for a registry.
652
+ #
653
+ # @param next_page_link [String] The NextLink from the previous successful call
654
+ # to List operation.
655
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
656
+ # will be added to the HTTP request.
657
+ #
658
+ # @return [BuildListResult] operation results.
659
+ #
660
+ def list_next(next_page_link, custom_headers:nil)
661
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
662
+ response.body unless response.nil?
663
+ end
664
+
665
+ #
666
+ # Gets all the builds for a registry.
667
+ #
668
+ # @param next_page_link [String] The NextLink from the previous successful call
669
+ # to List operation.
670
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
671
+ # will be added to the HTTP request.
672
+ #
673
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
674
+ #
675
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
676
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
677
+ end
678
+
679
+ #
680
+ # Gets all the builds for a registry.
681
+ #
682
+ # @param next_page_link [String] The NextLink from the previous successful call
683
+ # to List operation.
684
+ # @param [Hash{String => String}] A hash of custom headers that will be added
685
+ # to the HTTP request.
686
+ #
687
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
688
+ #
689
+ def list_next_async(next_page_link, custom_headers:nil)
690
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
691
+
692
+
693
+ request_headers = {}
694
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
695
+
696
+ # Set Headers
697
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
698
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
699
+ path_template = '{nextLink}'
700
+
701
+ request_url = @base_url || @client.base_url
702
+
703
+ options = {
704
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
705
+ skip_encoding_path_params: {'nextLink' => next_page_link},
706
+ headers: request_headers.merge(custom_headers || {}),
707
+ base_url: request_url
708
+ }
709
+ promise = @client.make_request_async(:get, path_template, options)
710
+
711
+ promise = promise.then do |result|
712
+ http_response = result.response
713
+ status_code = http_response.status
714
+ response_content = http_response.body
715
+ unless status_code == 200
716
+ error_model = JSON.load(response_content)
717
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
718
+ end
719
+
720
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
721
+ # Deserialize Response
722
+ if status_code == 200
723
+ begin
724
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
725
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildListResult.mapper()
726
+ result.body = @client.deserialize(result_mapper, parsed_response)
727
+ rescue Exception => e
728
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
729
+ end
730
+ end
731
+
732
+ result
733
+ end
734
+
735
+ promise.execute
736
+ end
737
+
738
+ #
739
+ # Gets all the builds for a registry.
740
+ #
741
+ # @param resource_group_name [String] The name of the resource group to which
742
+ # the container registry belongs.
743
+ # @param registry_name [String] The name of the container registry.
744
+ # @param filter [String] The builds filter to apply on the operation.
745
+ # @param top [Integer] $top is supported for get list of builds, which limits
746
+ # the maximum number of builds to return.
747
+ # @param skip_token [String] $skipToken is supported on get list of builds,
748
+ # which provides the next page in the list of builds.
749
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
750
+ # will be added to the HTTP request.
751
+ #
752
+ # @return [BuildListResult] which provide lazy access to pages of the response.
753
+ #
754
+ def list_as_lazy(resource_group_name, registry_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
755
+ response = list_async(resource_group_name, registry_name, filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers).value!
756
+ unless response.nil?
757
+ page = response.body
758
+ page.next_method = Proc.new do |next_page_link|
759
+ list_next_async(next_page_link, custom_headers:custom_headers)
760
+ end
761
+ page
762
+ end
763
+ end
764
+
765
+ end
766
+ end