azure_mgmt_media_services 0.16.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-10-01/generated/azure_mgmt_media_services/media_services_management_client.rb +7 -6
  3. data/lib/2018-03-30-preview/generated/azure_mgmt_media_services.rb +6 -6
  4. data/lib/2018-03-30-preview/generated/azure_mgmt_media_services/azure_media_services.rb +7 -6
  5. data/lib/2018-03-30-preview/generated/azure_mgmt_media_services/models/api_error.rb +1 -1
  6. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services.rb +212 -0
  7. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/assets.rb +946 -0
  8. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/azure_media_services.rb +177 -0
  9. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/content_key_policies.rb +815 -0
  10. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/jobs.rb +702 -0
  11. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/live_events.rb +1285 -0
  12. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/live_outputs.rb +706 -0
  13. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/locations.rb +130 -0
  14. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/mediaservices.rb +1069 -0
  15. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/aac_audio.rb +95 -0
  16. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/aac_audio_profile.rb +17 -0
  17. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/akamai_access_control.rb +56 -0
  18. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/akamai_signature_header_authentication_key.rb +68 -0
  19. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/api_error.rb +47 -0
  20. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/asset.rb +157 -0
  21. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/asset_collection.rb +99 -0
  22. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/asset_container_permission.rb +17 -0
  23. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/asset_container_sas.rb +54 -0
  24. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/asset_storage_encryption_format.rb +16 -0
  25. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/asset_storage_encryption_key.rb +46 -0
  26. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/audio.rb +92 -0
  27. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/audio_analyzer_preset.rb +66 -0
  28. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/audio_overlay.rb +98 -0
  29. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/built_in_standard_encoder_preset.rb +66 -0
  30. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/cbcs_drm_configuration.rb +73 -0
  31. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/cenc_drm_configuration.rb +61 -0
  32. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/check_name_availability_input.rb +58 -0
  33. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/codec.rb +66 -0
  34. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/common_encryption_cbcs.rb +95 -0
  35. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/common_encryption_cenc.rb +95 -0
  36. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy.rb +129 -0
  37. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_clear_key_configuration.rb +50 -0
  38. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_collection.rb +100 -0
  39. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_configuration.rb +51 -0
  40. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_fair_play_configuration.rb +111 -0
  41. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_fair_play_rental_and_lease_key_type.rb +18 -0
  42. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_open_restriction.rb +51 -0
  43. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_option.rb +87 -0
  44. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_play_ready_configuration.rb +82 -0
  45. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_play_ready_content_encryption_key_from_header.rb +51 -0
  46. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_play_ready_content_encryption_key_from_key_identifier.rb +64 -0
  47. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_play_ready_content_key_location.rb +49 -0
  48. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_play_ready_content_type.rb +18 -0
  49. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_play_ready_explicit_analog_television_restriction.rb +61 -0
  50. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_play_ready_license.rb +156 -0
  51. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_play_ready_license_type.rb +17 -0
  52. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_play_ready_play_right.rb +196 -0
  53. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_play_ready_unknown_output_passing_option.rb +18 -0
  54. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_properties.rb +102 -0
  55. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_restriction.rb +49 -0
  56. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_restriction_token_key.rb +49 -0
  57. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_restriction_token_type.rb +17 -0
  58. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_rsa_token_key.rb +72 -0
  59. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_symmetric_token_key.rb +61 -0
  60. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_token_claim.rb +57 -0
  61. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_token_restriction.rb +156 -0
  62. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_unknown_configuration.rb +51 -0
  63. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_unknown_restriction.rb +51 -0
  64. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_widevine_configuration.rb +61 -0
  65. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/content_key_policy_x509certificate_token_key.rb +62 -0
  66. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/copy_audio.rb +58 -0
  67. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/copy_video.rb +59 -0
  68. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/cross_site_access_policies.rb +58 -0
  69. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/default_key.rb +59 -0
  70. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/deinterlace.rb +62 -0
  71. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/deinterlace_mode.rb +16 -0
  72. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/deinterlace_parity.rb +17 -0
  73. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/enabled_protocols.rb +79 -0
  74. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/encoder_named_preset.rb +19 -0
  75. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/encryption_scheme.rb +18 -0
  76. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/entity_name_availability_check_output.rb +69 -0
  77. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/entropy_mode.rb +16 -0
  78. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/envelope_encryption.rb +94 -0
  79. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/filters.rb +98 -0
  80. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/format.rb +69 -0
  81. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/h264complexity.rb +17 -0
  82. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/h264layer.rb +191 -0
  83. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/h264video.rb +124 -0
  84. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/h264video_profile.rb +20 -0
  85. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/hls.rb +47 -0
  86. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/image.rb +121 -0
  87. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/image_format.rb +58 -0
  88. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/ipaccess_control.rb +55 -0
  89. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/iprange.rb +68 -0
  90. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/job.rb +186 -0
  91. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/job_collection.rb +99 -0
  92. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/job_error.rb +117 -0
  93. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/job_error_category.rb +19 -0
  94. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/job_error_code.rb +23 -0
  95. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/job_error_detail.rb +59 -0
  96. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/job_input.rb +65 -0
  97. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/job_input_asset.rb +85 -0
  98. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/job_input_clip.rb +77 -0
  99. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/job_input_http.rb +87 -0
  100. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/job_inputs.rb +80 -0
  101. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/job_output.rb +90 -0
  102. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/job_output_asset.rb +90 -0
  103. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/job_retry.rb +16 -0
  104. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/job_state.rb +21 -0
  105. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/jpg_format.rb +58 -0
  106. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/jpg_image.rb +121 -0
  107. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/jpg_layer.rb +86 -0
  108. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/layer.rb +93 -0
  109. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/list_container_sas_input.rb +60 -0
  110. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/list_content_keys_response.rb +56 -0
  111. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/list_paths_response.rb +76 -0
  112. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/live_event.rb +227 -0
  113. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/live_event_action_input.rb +46 -0
  114. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/live_event_encoding.rb +59 -0
  115. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/live_event_encoding_type.rb +16 -0
  116. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/live_event_endpoint.rb +57 -0
  117. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/live_event_input.rb +92 -0
  118. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/live_event_input_protocol.rb +16 -0
  119. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/live_event_list_result.rb +110 -0
  120. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/live_event_preview.rb +107 -0
  121. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/live_event_preview_access_control.rb +47 -0
  122. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/live_event_resource_state.rb +19 -0
  123. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/live_output.rb +181 -0
  124. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/live_output_list_result.rb +111 -0
  125. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/live_output_resource_state.rb +17 -0
  126. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/location.rb +47 -0
  127. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/media_service.rb +118 -0
  128. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/media_service_collection.rb +99 -0
  129. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/mp4format.rb +75 -0
  130. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/multi_bitrate_format.rb +84 -0
  131. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/no_encryption.rb +47 -0
  132. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/odata_error.rb +89 -0
  133. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/on_error_type.rb +16 -0
  134. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/operation.rb +58 -0
  135. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/operation_collection.rb +99 -0
  136. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/operation_display.rb +79 -0
  137. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/output_file.rb +59 -0
  138. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/overlay.rb +132 -0
  139. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/png_format.rb +58 -0
  140. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/png_image.rb +121 -0
  141. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/png_layer.rb +74 -0
  142. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/preset.rb +50 -0
  143. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/priority.rb +17 -0
  144. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/provider.rb +46 -0
  145. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/proxy_resource.rb +62 -0
  146. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/rectangle.rb +88 -0
  147. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/resource.rb +71 -0
  148. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/rotation.rb +20 -0
  149. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/standard_encoder_preset.rb +110 -0
  150. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/storage_account.rb +63 -0
  151. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/storage_account_type.rb +16 -0
  152. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/stream_options_flag.rb +16 -0
  153. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_endpoint.rb +284 -0
  154. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_endpoint_access_control.rb +60 -0
  155. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_endpoint_list_result.rb +111 -0
  156. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_endpoint_resource_state.rb +20 -0
  157. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_entity_scale_unit.rb +47 -0
  158. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_locator.rb +185 -0
  159. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_locator_collection.rb +100 -0
  160. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_locator_content_key.rb +115 -0
  161. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_locator_content_key_type.rb +17 -0
  162. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_path.rb +82 -0
  163. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_policy.rb +133 -0
  164. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_policy_collection.rb +99 -0
  165. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_policy_content_key.rb +78 -0
  166. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_policy_content_keys.rb +68 -0
  167. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_policy_fair_play_configuration.rb +59 -0
  168. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_policy_play_ready_configuration.rb +59 -0
  169. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_policy_streaming_protocol.rb +18 -0
  170. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/streaming_policy_widevine_configuration.rb +48 -0
  171. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/stretch_mode.rb +17 -0
  172. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/subscription_media_service.rb +118 -0
  173. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/subscription_media_service_collection.rb +100 -0
  174. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/sync_storage_keys_input.rb +46 -0
  175. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/track_property_compare_operation.rb +16 -0
  176. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/track_property_condition.rb +72 -0
  177. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/track_property_type.rb +16 -0
  178. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/track_selection.rb +56 -0
  179. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/tracked_resource.rb +92 -0
  180. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/transform.rb +123 -0
  181. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/transform_collection.rb +99 -0
  182. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/transform_output.rb +83 -0
  183. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/transport_stream_format.rb +76 -0
  184. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/video.rb +86 -0
  185. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/video_analyzer_preset.rb +71 -0
  186. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/video_layer.rb +156 -0
  187. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/models/video_overlay.rb +136 -0
  188. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/module_definition.rb +9 -0
  189. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/operations.rb +229 -0
  190. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/streaming_endpoints.rb +1308 -0
  191. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/streaming_locators.rb +794 -0
  192. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/streaming_policies.rb +584 -0
  193. data/lib/2018-06-01-preview/generated/azure_mgmt_media_services/transforms.rb +714 -0
  194. data/lib/azure_mgmt_media_services.rb +1 -0
  195. data/lib/profiles/latest/modules/mediaservices_profile_module.rb +412 -416
  196. data/lib/version.rb +1 -1
  197. metadata +192 -4
@@ -0,0 +1,177 @@
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::MediaServices::Mgmt::V2018_06_01_preview
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class AzureMediaServices < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] The unique identifier for a Microsoft Azure
21
+ # subscription.
22
+ attr_accessor :subscription_id
23
+
24
+ # @return [String] The Version of the API to be used with the client
25
+ # request.
26
+ attr_reader :api_version
27
+
28
+ # @return [String] The preferred language for the response.
29
+ attr_accessor :accept_language
30
+
31
+ # @return [Integer] The retry timeout in seconds for Long Running
32
+ # Operations. Default value is 30.
33
+ attr_accessor :long_running_operation_retry_timeout
34
+
35
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
36
+ # generated. When set to true a unique x-ms-client-request-id value is
37
+ # generated and included in each request. Default is true.
38
+ attr_accessor :generate_client_request_id
39
+
40
+ # @return [Operations] operations
41
+ attr_reader :operations
42
+
43
+ # @return [Mediaservices] mediaservices
44
+ attr_reader :mediaservices
45
+
46
+ # @return [Locations] locations
47
+ attr_reader :locations
48
+
49
+ # @return [Assets] assets
50
+ attr_reader :assets
51
+
52
+ # @return [ContentKeyPolicies] content_key_policies
53
+ attr_reader :content_key_policies
54
+
55
+ # @return [Transforms] transforms
56
+ attr_reader :transforms
57
+
58
+ # @return [Jobs] jobs
59
+ attr_reader :jobs
60
+
61
+ # @return [StreamingPolicies] streaming_policies
62
+ attr_reader :streaming_policies
63
+
64
+ # @return [StreamingLocators] streaming_locators
65
+ attr_reader :streaming_locators
66
+
67
+ # @return [LiveEvents] live_events
68
+ attr_reader :live_events
69
+
70
+ # @return [LiveOutputs] live_outputs
71
+ attr_reader :live_outputs
72
+
73
+ # @return [StreamingEndpoints] streaming_endpoints
74
+ attr_reader :streaming_endpoints
75
+
76
+ #
77
+ # Creates initializes a new instance of the AzureMediaServices class.
78
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
79
+ # @param base_url [String] the base URI of the service.
80
+ # @param options [Array] filters to be applied to the HTTP requests.
81
+ #
82
+ def initialize(credentials = nil, base_url = nil, options = nil)
83
+ super(credentials, options)
84
+ @base_url = base_url || 'https://management.azure.com'
85
+
86
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
87
+ @credentials = credentials
88
+
89
+ @operations = Operations.new(self)
90
+ @mediaservices = Mediaservices.new(self)
91
+ @locations = Locations.new(self)
92
+ @assets = Assets.new(self)
93
+ @content_key_policies = ContentKeyPolicies.new(self)
94
+ @transforms = Transforms.new(self)
95
+ @jobs = Jobs.new(self)
96
+ @streaming_policies = StreamingPolicies.new(self)
97
+ @streaming_locators = StreamingLocators.new(self)
98
+ @live_events = LiveEvents.new(self)
99
+ @live_outputs = LiveOutputs.new(self)
100
+ @streaming_endpoints = StreamingEndpoints.new(self)
101
+ @api_version = '2018-06-01-preview'
102
+ @accept_language = 'en-US'
103
+ @long_running_operation_retry_timeout = 30
104
+ @generate_client_request_id = true
105
+ add_telemetry
106
+ end
107
+
108
+ #
109
+ # Makes a request and returns the body of the response.
110
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
111
+ # @param path [String] the path, relative to {base_url}.
112
+ # @param options [Hash{String=>String}] specifying any request options like :body.
113
+ # @return [Hash{String=>String}] containing the body of the response.
114
+ # Example:
115
+ #
116
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
117
+ # path = "/path"
118
+ # options = {
119
+ # body: request_content,
120
+ # query_params: {'api-version' => '2016-02-01'}
121
+ # }
122
+ # result = @client.make_request(:put, path, options)
123
+ #
124
+ def make_request(method, path, options = {})
125
+ result = make_request_with_http_info(method, path, options)
126
+ result.body unless result.nil?
127
+ end
128
+
129
+ #
130
+ # Makes a request and returns the operation response.
131
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
132
+ # @param path [String] the path, relative to {base_url}.
133
+ # @param options [Hash{String=>String}] specifying any request options like :body.
134
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
135
+ #
136
+ def make_request_with_http_info(method, path, options = {})
137
+ result = make_request_async(method, path, options).value!
138
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
139
+ result
140
+ end
141
+
142
+ #
143
+ # Makes a request asynchronously.
144
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
145
+ # @param path [String] the path, relative to {base_url}.
146
+ # @param options [Hash{String=>String}] specifying any request options like :body.
147
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
148
+ #
149
+ def make_request_async(method, path, options = {})
150
+ fail ArgumentError, 'method is nil' if method.nil?
151
+ fail ArgumentError, 'path is nil' if path.nil?
152
+
153
+ request_url = options[:base_url] || @base_url
154
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
155
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
156
+ end
157
+
158
+ request_headers = @request_headers
159
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
160
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
161
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
162
+
163
+ super(request_url, method, path, options)
164
+ end
165
+
166
+
167
+ private
168
+ #
169
+ # Adds telemetry information.
170
+ #
171
+ def add_telemetry
172
+ sdk_information = 'azure_mgmt_media_services'
173
+ sdk_information = "#{sdk_information}/0.17.0"
174
+ add_user_agent_information(sdk_information)
175
+ end
176
+ end
177
+ end
@@ -0,0 +1,815 @@
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::MediaServices::Mgmt::V2018_06_01_preview
7
+ #
8
+ # ContentKeyPolicies
9
+ #
10
+ class ContentKeyPolicies
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ContentKeyPolicies class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [AzureMediaServices] reference to the AzureMediaServices
22
+ attr_reader :client
23
+
24
+ #
25
+ # List Content Key Policies
26
+ #
27
+ # Lists the Content Key Policies in the account
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group within the
30
+ # Azure subscription.
31
+ # @param account_name [String] The Media Services account name.
32
+ # @param filter [String] Restricts the set of items returned.
33
+ # @param top [Integer] Specifies a non-negative integer n that limits the
34
+ # number of items returned from a collection. The service returns the number of
35
+ # available items up to but not greater than the specified value n.
36
+ # @param orderby [String] Specifies the the key by which the result collection
37
+ # should be ordered.
38
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
39
+ # will be added to the HTTP request.
40
+ #
41
+ # @return [Array<ContentKeyPolicy>] operation results.
42
+ #
43
+ def list(resource_group_name, account_name, filter:nil, top:nil, orderby:nil, custom_headers:nil)
44
+ first_page = list_as_lazy(resource_group_name, account_name, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers)
45
+ first_page.get_all_items
46
+ end
47
+
48
+ #
49
+ # List Content Key Policies
50
+ #
51
+ # Lists the Content Key Policies in the account
52
+ #
53
+ # @param resource_group_name [String] The name of the resource group within the
54
+ # Azure subscription.
55
+ # @param account_name [String] The Media Services account name.
56
+ # @param filter [String] Restricts the set of items returned.
57
+ # @param top [Integer] Specifies a non-negative integer n that limits the
58
+ # number of items returned from a collection. The service returns the number of
59
+ # available items up to but not greater than the specified value n.
60
+ # @param orderby [String] Specifies the the key by which the result collection
61
+ # should be ordered.
62
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
63
+ # will be added to the HTTP request.
64
+ #
65
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
66
+ #
67
+ def list_with_http_info(resource_group_name, account_name, filter:nil, top:nil, orderby:nil, custom_headers:nil)
68
+ list_async(resource_group_name, account_name, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
69
+ end
70
+
71
+ #
72
+ # List Content Key Policies
73
+ #
74
+ # Lists the Content Key Policies in the account
75
+ #
76
+ # @param resource_group_name [String] The name of the resource group within the
77
+ # Azure subscription.
78
+ # @param account_name [String] The Media Services account name.
79
+ # @param filter [String] Restricts the set of items returned.
80
+ # @param top [Integer] Specifies a non-negative integer n that limits the
81
+ # number of items returned from a collection. The service returns the number of
82
+ # available items up to but not greater than the specified value n.
83
+ # @param orderby [String] Specifies the the key by which the result collection
84
+ # should be ordered.
85
+ # @param [Hash{String => String}] A hash of custom headers that will be added
86
+ # to the HTTP request.
87
+ #
88
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
89
+ #
90
+ def list_async(resource_group_name, account_name, filter:nil, top:nil, orderby:nil, custom_headers:nil)
91
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
92
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
93
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
94
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
95
+
96
+
97
+ request_headers = {}
98
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
99
+
100
+ # Set Headers
101
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
102
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
103
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies'
104
+
105
+ request_url = @base_url || @client.base_url
106
+
107
+ options = {
108
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
109
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
110
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$orderby' => orderby},
111
+ headers: request_headers.merge(custom_headers || {}),
112
+ base_url: request_url
113
+ }
114
+ promise = @client.make_request_async(:get, path_template, options)
115
+
116
+ promise = promise.then do |result|
117
+ http_response = result.response
118
+ status_code = http_response.status
119
+ response_content = http_response.body
120
+ unless status_code == 200
121
+ error_model = JSON.load(response_content)
122
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
123
+ end
124
+
125
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
126
+ # Deserialize Response
127
+ if status_code == 200
128
+ begin
129
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
130
+ result_mapper = Azure::MediaServices::Mgmt::V2018_06_01_preview::Models::ContentKeyPolicyCollection.mapper()
131
+ result.body = @client.deserialize(result_mapper, parsed_response)
132
+ rescue Exception => e
133
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
134
+ end
135
+ end
136
+
137
+ result
138
+ end
139
+
140
+ promise.execute
141
+ end
142
+
143
+ #
144
+ # Get a Content Key Policy
145
+ #
146
+ # Get the details of a Content Key Policy in the Media Services account
147
+ #
148
+ # @param resource_group_name [String] The name of the resource group within the
149
+ # Azure subscription.
150
+ # @param account_name [String] The Media Services account name.
151
+ # @param content_key_policy_name [String] The Content Key Policy name.
152
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
153
+ # will be added to the HTTP request.
154
+ #
155
+ # @return [ContentKeyPolicy] operation results.
156
+ #
157
+ def get(resource_group_name, account_name, content_key_policy_name, custom_headers:nil)
158
+ response = get_async(resource_group_name, account_name, content_key_policy_name, custom_headers:custom_headers).value!
159
+ response.body unless response.nil?
160
+ end
161
+
162
+ #
163
+ # Get a Content Key Policy
164
+ #
165
+ # Get the details of a Content Key Policy in the Media Services account
166
+ #
167
+ # @param resource_group_name [String] The name of the resource group within the
168
+ # Azure subscription.
169
+ # @param account_name [String] The Media Services account name.
170
+ # @param content_key_policy_name [String] The Content Key Policy name.
171
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
172
+ # will be added to the HTTP request.
173
+ #
174
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
175
+ #
176
+ def get_with_http_info(resource_group_name, account_name, content_key_policy_name, custom_headers:nil)
177
+ get_async(resource_group_name, account_name, content_key_policy_name, custom_headers:custom_headers).value!
178
+ end
179
+
180
+ #
181
+ # Get a Content Key Policy
182
+ #
183
+ # Get the details of a Content Key Policy in the Media Services account
184
+ #
185
+ # @param resource_group_name [String] The name of the resource group within the
186
+ # Azure subscription.
187
+ # @param account_name [String] The Media Services account name.
188
+ # @param content_key_policy_name [String] The Content Key Policy name.
189
+ # @param [Hash{String => String}] A hash of custom headers that will be added
190
+ # to the HTTP request.
191
+ #
192
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
193
+ #
194
+ def get_async(resource_group_name, account_name, content_key_policy_name, custom_headers:nil)
195
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
196
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
197
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
198
+ fail ArgumentError, 'content_key_policy_name is nil' if content_key_policy_name.nil?
199
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
200
+
201
+
202
+ request_headers = {}
203
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
204
+
205
+ # Set Headers
206
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
207
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
208
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}'
209
+
210
+ request_url = @base_url || @client.base_url
211
+
212
+ options = {
213
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
214
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'contentKeyPolicyName' => content_key_policy_name},
215
+ query_params: {'api-version' => @client.api_version},
216
+ headers: request_headers.merge(custom_headers || {}),
217
+ base_url: request_url
218
+ }
219
+ promise = @client.make_request_async(:get, path_template, options)
220
+
221
+ promise = promise.then do |result|
222
+ http_response = result.response
223
+ status_code = http_response.status
224
+ response_content = http_response.body
225
+ unless status_code == 200 || status_code == 404
226
+ error_model = JSON.load(response_content)
227
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
228
+ end
229
+
230
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
231
+ # Deserialize Response
232
+ if status_code == 200
233
+ begin
234
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
235
+ result_mapper = Azure::MediaServices::Mgmt::V2018_06_01_preview::Models::ContentKeyPolicy.mapper()
236
+ result.body = @client.deserialize(result_mapper, parsed_response)
237
+ rescue Exception => e
238
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
239
+ end
240
+ end
241
+
242
+ result
243
+ end
244
+
245
+ promise.execute
246
+ end
247
+
248
+ #
249
+ # Create or update an Content Key Policy
250
+ #
251
+ # Create or update a Content Key Policy in the Media Services account
252
+ #
253
+ # @param resource_group_name [String] The name of the resource group within the
254
+ # Azure subscription.
255
+ # @param account_name [String] The Media Services account name.
256
+ # @param content_key_policy_name [String] The Content Key Policy name.
257
+ # @param parameters [ContentKeyPolicy] The request parameters
258
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
259
+ # will be added to the HTTP request.
260
+ #
261
+ # @return [ContentKeyPolicy] operation results.
262
+ #
263
+ def create_or_update(resource_group_name, account_name, content_key_policy_name, parameters, custom_headers:nil)
264
+ response = create_or_update_async(resource_group_name, account_name, content_key_policy_name, parameters, custom_headers:custom_headers).value!
265
+ response.body unless response.nil?
266
+ end
267
+
268
+ #
269
+ # Create or update an Content Key Policy
270
+ #
271
+ # Create or update a Content Key Policy in the Media Services account
272
+ #
273
+ # @param resource_group_name [String] The name of the resource group within the
274
+ # Azure subscription.
275
+ # @param account_name [String] The Media Services account name.
276
+ # @param content_key_policy_name [String] The Content Key Policy name.
277
+ # @param parameters [ContentKeyPolicy] The request parameters
278
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
279
+ # will be added to the HTTP request.
280
+ #
281
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
282
+ #
283
+ def create_or_update_with_http_info(resource_group_name, account_name, content_key_policy_name, parameters, custom_headers:nil)
284
+ create_or_update_async(resource_group_name, account_name, content_key_policy_name, parameters, custom_headers:custom_headers).value!
285
+ end
286
+
287
+ #
288
+ # Create or update an Content Key Policy
289
+ #
290
+ # Create or update a Content Key Policy in the Media Services account
291
+ #
292
+ # @param resource_group_name [String] The name of the resource group within the
293
+ # Azure subscription.
294
+ # @param account_name [String] The Media Services account name.
295
+ # @param content_key_policy_name [String] The Content Key Policy name.
296
+ # @param parameters [ContentKeyPolicy] The request parameters
297
+ # @param [Hash{String => String}] A hash of custom headers that will be added
298
+ # to the HTTP request.
299
+ #
300
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
301
+ #
302
+ def create_or_update_async(resource_group_name, account_name, content_key_policy_name, parameters, custom_headers:nil)
303
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
304
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
305
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
306
+ fail ArgumentError, 'content_key_policy_name is nil' if content_key_policy_name.nil?
307
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
308
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
309
+
310
+
311
+ request_headers = {}
312
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
313
+
314
+ # Set Headers
315
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
316
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
317
+
318
+ # Serialize Request
319
+ request_mapper = Azure::MediaServices::Mgmt::V2018_06_01_preview::Models::ContentKeyPolicy.mapper()
320
+ request_content = @client.serialize(request_mapper, parameters)
321
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
322
+
323
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}'
324
+
325
+ request_url = @base_url || @client.base_url
326
+
327
+ options = {
328
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
329
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'contentKeyPolicyName' => content_key_policy_name},
330
+ query_params: {'api-version' => @client.api_version},
331
+ body: request_content,
332
+ headers: request_headers.merge(custom_headers || {}),
333
+ base_url: request_url
334
+ }
335
+ promise = @client.make_request_async(:put, path_template, options)
336
+
337
+ promise = promise.then do |result|
338
+ http_response = result.response
339
+ status_code = http_response.status
340
+ response_content = http_response.body
341
+ unless status_code == 200 || status_code == 201
342
+ error_model = JSON.load(response_content)
343
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
344
+ end
345
+
346
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
347
+ # Deserialize Response
348
+ if status_code == 200
349
+ begin
350
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
351
+ result_mapper = Azure::MediaServices::Mgmt::V2018_06_01_preview::Models::ContentKeyPolicy.mapper()
352
+ result.body = @client.deserialize(result_mapper, parsed_response)
353
+ rescue Exception => e
354
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
355
+ end
356
+ end
357
+ # Deserialize Response
358
+ if status_code == 201
359
+ begin
360
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
361
+ result_mapper = Azure::MediaServices::Mgmt::V2018_06_01_preview::Models::ContentKeyPolicy.mapper()
362
+ result.body = @client.deserialize(result_mapper, parsed_response)
363
+ rescue Exception => e
364
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
365
+ end
366
+ end
367
+
368
+ result
369
+ end
370
+
371
+ promise.execute
372
+ end
373
+
374
+ #
375
+ # Delete a Content Key Policy
376
+ #
377
+ # Deletes a Content Key Policy in the Media Services account
378
+ #
379
+ # @param resource_group_name [String] The name of the resource group within the
380
+ # Azure subscription.
381
+ # @param account_name [String] The Media Services account name.
382
+ # @param content_key_policy_name [String] The Content Key Policy name.
383
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
384
+ # will be added to the HTTP request.
385
+ #
386
+ #
387
+ def delete(resource_group_name, account_name, content_key_policy_name, custom_headers:nil)
388
+ response = delete_async(resource_group_name, account_name, content_key_policy_name, custom_headers:custom_headers).value!
389
+ nil
390
+ end
391
+
392
+ #
393
+ # Delete a Content Key Policy
394
+ #
395
+ # Deletes a Content Key Policy in the Media Services account
396
+ #
397
+ # @param resource_group_name [String] The name of the resource group within the
398
+ # Azure subscription.
399
+ # @param account_name [String] The Media Services account name.
400
+ # @param content_key_policy_name [String] The Content Key Policy name.
401
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
402
+ # will be added to the HTTP request.
403
+ #
404
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
405
+ #
406
+ def delete_with_http_info(resource_group_name, account_name, content_key_policy_name, custom_headers:nil)
407
+ delete_async(resource_group_name, account_name, content_key_policy_name, custom_headers:custom_headers).value!
408
+ end
409
+
410
+ #
411
+ # Delete a Content Key Policy
412
+ #
413
+ # Deletes a Content Key Policy in the Media Services account
414
+ #
415
+ # @param resource_group_name [String] The name of the resource group within the
416
+ # Azure subscription.
417
+ # @param account_name [String] The Media Services account name.
418
+ # @param content_key_policy_name [String] The Content Key Policy name.
419
+ # @param [Hash{String => String}] A hash of custom headers that will be added
420
+ # to the HTTP request.
421
+ #
422
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
423
+ #
424
+ def delete_async(resource_group_name, account_name, content_key_policy_name, custom_headers:nil)
425
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
426
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
427
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
428
+ fail ArgumentError, 'content_key_policy_name is nil' if content_key_policy_name.nil?
429
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
430
+
431
+
432
+ request_headers = {}
433
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
434
+
435
+ # Set Headers
436
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
437
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
438
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}'
439
+
440
+ request_url = @base_url || @client.base_url
441
+
442
+ options = {
443
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
444
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'contentKeyPolicyName' => content_key_policy_name},
445
+ query_params: {'api-version' => @client.api_version},
446
+ headers: request_headers.merge(custom_headers || {}),
447
+ base_url: request_url
448
+ }
449
+ promise = @client.make_request_async(:delete, path_template, options)
450
+
451
+ promise = promise.then do |result|
452
+ http_response = result.response
453
+ status_code = http_response.status
454
+ response_content = http_response.body
455
+ unless status_code == 200 || status_code == 204
456
+ error_model = JSON.load(response_content)
457
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
458
+ end
459
+
460
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
461
+
462
+ result
463
+ end
464
+
465
+ promise.execute
466
+ end
467
+
468
+ #
469
+ # Update a Content Key Policy
470
+ #
471
+ # Updates an existing Content Key Policy in the Media Services account
472
+ #
473
+ # @param resource_group_name [String] The name of the resource group within the
474
+ # Azure subscription.
475
+ # @param account_name [String] The Media Services account name.
476
+ # @param content_key_policy_name [String] The Content Key Policy name.
477
+ # @param parameters [ContentKeyPolicy] The request parameters
478
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
479
+ # will be added to the HTTP request.
480
+ #
481
+ # @return [ContentKeyPolicy] operation results.
482
+ #
483
+ def update(resource_group_name, account_name, content_key_policy_name, parameters, custom_headers:nil)
484
+ response = update_async(resource_group_name, account_name, content_key_policy_name, parameters, custom_headers:custom_headers).value!
485
+ response.body unless response.nil?
486
+ end
487
+
488
+ #
489
+ # Update a Content Key Policy
490
+ #
491
+ # Updates an existing Content Key Policy in the Media Services account
492
+ #
493
+ # @param resource_group_name [String] The name of the resource group within the
494
+ # Azure subscription.
495
+ # @param account_name [String] The Media Services account name.
496
+ # @param content_key_policy_name [String] The Content Key Policy name.
497
+ # @param parameters [ContentKeyPolicy] The request parameters
498
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
499
+ # will be added to the HTTP request.
500
+ #
501
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
502
+ #
503
+ def update_with_http_info(resource_group_name, account_name, content_key_policy_name, parameters, custom_headers:nil)
504
+ update_async(resource_group_name, account_name, content_key_policy_name, parameters, custom_headers:custom_headers).value!
505
+ end
506
+
507
+ #
508
+ # Update a Content Key Policy
509
+ #
510
+ # Updates an existing Content Key Policy in the Media Services account
511
+ #
512
+ # @param resource_group_name [String] The name of the resource group within the
513
+ # Azure subscription.
514
+ # @param account_name [String] The Media Services account name.
515
+ # @param content_key_policy_name [String] The Content Key Policy name.
516
+ # @param parameters [ContentKeyPolicy] The request parameters
517
+ # @param [Hash{String => String}] A hash of custom headers that will be added
518
+ # to the HTTP request.
519
+ #
520
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
521
+ #
522
+ def update_async(resource_group_name, account_name, content_key_policy_name, parameters, custom_headers:nil)
523
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
524
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
525
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
526
+ fail ArgumentError, 'content_key_policy_name is nil' if content_key_policy_name.nil?
527
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
528
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
529
+
530
+
531
+ request_headers = {}
532
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
533
+
534
+ # Set Headers
535
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
536
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
537
+
538
+ # Serialize Request
539
+ request_mapper = Azure::MediaServices::Mgmt::V2018_06_01_preview::Models::ContentKeyPolicy.mapper()
540
+ request_content = @client.serialize(request_mapper, parameters)
541
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
542
+
543
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}'
544
+
545
+ request_url = @base_url || @client.base_url
546
+
547
+ options = {
548
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
549
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'contentKeyPolicyName' => content_key_policy_name},
550
+ query_params: {'api-version' => @client.api_version},
551
+ body: request_content,
552
+ headers: request_headers.merge(custom_headers || {}),
553
+ base_url: request_url
554
+ }
555
+ promise = @client.make_request_async(:patch, path_template, options)
556
+
557
+ promise = promise.then do |result|
558
+ http_response = result.response
559
+ status_code = http_response.status
560
+ response_content = http_response.body
561
+ unless status_code == 200
562
+ error_model = JSON.load(response_content)
563
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
564
+ end
565
+
566
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
567
+ # Deserialize Response
568
+ if status_code == 200
569
+ begin
570
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
571
+ result_mapper = Azure::MediaServices::Mgmt::V2018_06_01_preview::Models::ContentKeyPolicy.mapper()
572
+ result.body = @client.deserialize(result_mapper, parsed_response)
573
+ rescue Exception => e
574
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
575
+ end
576
+ end
577
+
578
+ result
579
+ end
580
+
581
+ promise.execute
582
+ end
583
+
584
+ #
585
+ # Get a Content Key Policy with secrets
586
+ #
587
+ # Get a Content Key Policy including secret values
588
+ #
589
+ # @param resource_group_name [String] The name of the resource group within the
590
+ # Azure subscription.
591
+ # @param account_name [String] The Media Services account name.
592
+ # @param content_key_policy_name [String] The Content Key Policy name.
593
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
594
+ # will be added to the HTTP request.
595
+ #
596
+ # @return [ContentKeyPolicyProperties] operation results.
597
+ #
598
+ def get_policy_properties_with_secrets(resource_group_name, account_name, content_key_policy_name, custom_headers:nil)
599
+ response = get_policy_properties_with_secrets_async(resource_group_name, account_name, content_key_policy_name, custom_headers:custom_headers).value!
600
+ response.body unless response.nil?
601
+ end
602
+
603
+ #
604
+ # Get a Content Key Policy with secrets
605
+ #
606
+ # Get a Content Key Policy including secret values
607
+ #
608
+ # @param resource_group_name [String] The name of the resource group within the
609
+ # Azure subscription.
610
+ # @param account_name [String] The Media Services account name.
611
+ # @param content_key_policy_name [String] The Content Key Policy name.
612
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
613
+ # will be added to the HTTP request.
614
+ #
615
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
616
+ #
617
+ def get_policy_properties_with_secrets_with_http_info(resource_group_name, account_name, content_key_policy_name, custom_headers:nil)
618
+ get_policy_properties_with_secrets_async(resource_group_name, account_name, content_key_policy_name, custom_headers:custom_headers).value!
619
+ end
620
+
621
+ #
622
+ # Get a Content Key Policy with secrets
623
+ #
624
+ # Get a Content Key Policy including secret values
625
+ #
626
+ # @param resource_group_name [String] The name of the resource group within the
627
+ # Azure subscription.
628
+ # @param account_name [String] The Media Services account name.
629
+ # @param content_key_policy_name [String] The Content Key Policy name.
630
+ # @param [Hash{String => String}] A hash of custom headers that will be added
631
+ # to the HTTP request.
632
+ #
633
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
634
+ #
635
+ def get_policy_properties_with_secrets_async(resource_group_name, account_name, content_key_policy_name, custom_headers:nil)
636
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
637
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
638
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
639
+ fail ArgumentError, 'content_key_policy_name is nil' if content_key_policy_name.nil?
640
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
641
+
642
+
643
+ request_headers = {}
644
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
645
+
646
+ # Set Headers
647
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
648
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
649
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}/getPolicyPropertiesWithSecrets'
650
+
651
+ request_url = @base_url || @client.base_url
652
+
653
+ options = {
654
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
655
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'contentKeyPolicyName' => content_key_policy_name},
656
+ query_params: {'api-version' => @client.api_version},
657
+ headers: request_headers.merge(custom_headers || {}),
658
+ base_url: request_url
659
+ }
660
+ promise = @client.make_request_async(:post, path_template, options)
661
+
662
+ promise = promise.then do |result|
663
+ http_response = result.response
664
+ status_code = http_response.status
665
+ response_content = http_response.body
666
+ unless status_code == 200 || status_code == 404
667
+ error_model = JSON.load(response_content)
668
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
669
+ end
670
+
671
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
672
+ # Deserialize Response
673
+ if status_code == 200
674
+ begin
675
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
676
+ result_mapper = Azure::MediaServices::Mgmt::V2018_06_01_preview::Models::ContentKeyPolicyProperties.mapper()
677
+ result.body = @client.deserialize(result_mapper, parsed_response)
678
+ rescue Exception => e
679
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
680
+ end
681
+ end
682
+
683
+ result
684
+ end
685
+
686
+ promise.execute
687
+ end
688
+
689
+ #
690
+ # List Content Key Policies
691
+ #
692
+ # Lists the Content Key Policies in the account
693
+ #
694
+ # @param next_page_link [String] The NextLink from the previous successful call
695
+ # to List operation.
696
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
697
+ # will be added to the HTTP request.
698
+ #
699
+ # @return [ContentKeyPolicyCollection] operation results.
700
+ #
701
+ def list_next(next_page_link, custom_headers:nil)
702
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
703
+ response.body unless response.nil?
704
+ end
705
+
706
+ #
707
+ # List Content Key Policies
708
+ #
709
+ # Lists the Content Key Policies in the account
710
+ #
711
+ # @param next_page_link [String] The NextLink from the previous successful call
712
+ # to List operation.
713
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
714
+ # will be added to the HTTP request.
715
+ #
716
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
717
+ #
718
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
719
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
720
+ end
721
+
722
+ #
723
+ # List Content Key Policies
724
+ #
725
+ # Lists the Content Key Policies in the account
726
+ #
727
+ # @param next_page_link [String] The NextLink from the previous successful call
728
+ # to List operation.
729
+ # @param [Hash{String => String}] A hash of custom headers that will be added
730
+ # to the HTTP request.
731
+ #
732
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
733
+ #
734
+ def list_next_async(next_page_link, custom_headers:nil)
735
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
736
+
737
+
738
+ request_headers = {}
739
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
740
+
741
+ # Set Headers
742
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
743
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
744
+ path_template = '{nextLink}'
745
+
746
+ request_url = @base_url || @client.base_url
747
+
748
+ options = {
749
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
750
+ skip_encoding_path_params: {'nextLink' => next_page_link},
751
+ headers: request_headers.merge(custom_headers || {}),
752
+ base_url: request_url
753
+ }
754
+ promise = @client.make_request_async(:get, path_template, options)
755
+
756
+ promise = promise.then do |result|
757
+ http_response = result.response
758
+ status_code = http_response.status
759
+ response_content = http_response.body
760
+ unless status_code == 200
761
+ error_model = JSON.load(response_content)
762
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
763
+ end
764
+
765
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
766
+ # Deserialize Response
767
+ if status_code == 200
768
+ begin
769
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
770
+ result_mapper = Azure::MediaServices::Mgmt::V2018_06_01_preview::Models::ContentKeyPolicyCollection.mapper()
771
+ result.body = @client.deserialize(result_mapper, parsed_response)
772
+ rescue Exception => e
773
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
774
+ end
775
+ end
776
+
777
+ result
778
+ end
779
+
780
+ promise.execute
781
+ end
782
+
783
+ #
784
+ # List Content Key Policies
785
+ #
786
+ # Lists the Content Key Policies in the account
787
+ #
788
+ # @param resource_group_name [String] The name of the resource group within the
789
+ # Azure subscription.
790
+ # @param account_name [String] The Media Services account name.
791
+ # @param filter [String] Restricts the set of items returned.
792
+ # @param top [Integer] Specifies a non-negative integer n that limits the
793
+ # number of items returned from a collection. The service returns the number of
794
+ # available items up to but not greater than the specified value n.
795
+ # @param orderby [String] Specifies the the key by which the result collection
796
+ # should be ordered.
797
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
798
+ # will be added to the HTTP request.
799
+ #
800
+ # @return [ContentKeyPolicyCollection] which provide lazy access to pages of
801
+ # the response.
802
+ #
803
+ def list_as_lazy(resource_group_name, account_name, filter:nil, top:nil, orderby:nil, custom_headers:nil)
804
+ response = list_async(resource_group_name, account_name, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
805
+ unless response.nil?
806
+ page = response.body
807
+ page.next_method = Proc.new do |next_page_link|
808
+ list_next_async(next_page_link, custom_headers:custom_headers)
809
+ end
810
+ page
811
+ end
812
+ end
813
+
814
+ end
815
+ end