1package media 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "encoding/json" 23 "github.com/Azure/go-autorest/autorest" 24 "github.com/Azure/go-autorest/autorest/azure" 25 "github.com/Azure/go-autorest/autorest/date" 26 "github.com/Azure/go-autorest/autorest/to" 27 "github.com/Azure/go-autorest/tracing" 28 "github.com/satori/go.uuid" 29 "net/http" 30) 31 32// The package's fully qualified name. 33const fqdn = "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2018-07-01/media" 34 35// AacAudioProfile enumerates the values for aac audio profile. 36type AacAudioProfile string 37 38const ( 39 // AacLc Specifies that the output audio is to be encoded into AAC Low Complexity profile (AAC-LC). 40 AacLc AacAudioProfile = "AacLc" 41 // HeAacV1 Specifies that the output audio is to be encoded into HE-AAC v1 profile. 42 HeAacV1 AacAudioProfile = "HeAacV1" 43 // HeAacV2 Specifies that the output audio is to be encoded into HE-AAC v2 profile. 44 HeAacV2 AacAudioProfile = "HeAacV2" 45) 46 47// PossibleAacAudioProfileValues returns an array of possible values for the AacAudioProfile const type. 48func PossibleAacAudioProfileValues() []AacAudioProfile { 49 return []AacAudioProfile{AacLc, HeAacV1, HeAacV2} 50} 51 52// AnalysisResolution enumerates the values for analysis resolution. 53type AnalysisResolution string 54 55const ( 56 // SourceResolution ... 57 SourceResolution AnalysisResolution = "SourceResolution" 58 // StandardDefinition ... 59 StandardDefinition AnalysisResolution = "StandardDefinition" 60) 61 62// PossibleAnalysisResolutionValues returns an array of possible values for the AnalysisResolution const type. 63func PossibleAnalysisResolutionValues() []AnalysisResolution { 64 return []AnalysisResolution{SourceResolution, StandardDefinition} 65} 66 67// AssetContainerPermission enumerates the values for asset container permission. 68type AssetContainerPermission string 69 70const ( 71 // Read The SAS URL will allow read access to the container. 72 Read AssetContainerPermission = "Read" 73 // ReadWrite The SAS URL will allow read and write access to the container. 74 ReadWrite AssetContainerPermission = "ReadWrite" 75 // ReadWriteDelete The SAS URL will allow read, write and delete access to the container. 76 ReadWriteDelete AssetContainerPermission = "ReadWriteDelete" 77) 78 79// PossibleAssetContainerPermissionValues returns an array of possible values for the AssetContainerPermission const type. 80func PossibleAssetContainerPermissionValues() []AssetContainerPermission { 81 return []AssetContainerPermission{Read, ReadWrite, ReadWriteDelete} 82} 83 84// AssetStorageEncryptionFormat enumerates the values for asset storage encryption format. 85type AssetStorageEncryptionFormat string 86 87const ( 88 // MediaStorageClientEncryption The Asset is encrypted with Media Services client-side encryption. 89 MediaStorageClientEncryption AssetStorageEncryptionFormat = "MediaStorageClientEncryption" 90 // None The Asset does not use client-side storage encryption (this is the only allowed value for new 91 // Assets). 92 None AssetStorageEncryptionFormat = "None" 93) 94 95// PossibleAssetStorageEncryptionFormatValues returns an array of possible values for the AssetStorageEncryptionFormat const type. 96func PossibleAssetStorageEncryptionFormatValues() []AssetStorageEncryptionFormat { 97 return []AssetStorageEncryptionFormat{MediaStorageClientEncryption, None} 98} 99 100// ContentKeyPolicyFairPlayRentalAndLeaseKeyType enumerates the values for content key policy fair play rental 101// and lease key type. 102type ContentKeyPolicyFairPlayRentalAndLeaseKeyType string 103 104const ( 105 // PersistentLimited Content key can be persisted and the valid duration is limited by the Rental Duration 106 // value 107 PersistentLimited ContentKeyPolicyFairPlayRentalAndLeaseKeyType = "PersistentLimited" 108 // PersistentUnlimited Content key can be persisted with an unlimited duration 109 PersistentUnlimited ContentKeyPolicyFairPlayRentalAndLeaseKeyType = "PersistentUnlimited" 110 // Undefined Key duration is not specified. 111 Undefined ContentKeyPolicyFairPlayRentalAndLeaseKeyType = "Undefined" 112 // Unknown Represents a ContentKeyPolicyFairPlayRentalAndLeaseKeyType that is unavailable in current API 113 // version. 114 Unknown ContentKeyPolicyFairPlayRentalAndLeaseKeyType = "Unknown" 115) 116 117// PossibleContentKeyPolicyFairPlayRentalAndLeaseKeyTypeValues returns an array of possible values for the ContentKeyPolicyFairPlayRentalAndLeaseKeyType const type. 118func PossibleContentKeyPolicyFairPlayRentalAndLeaseKeyTypeValues() []ContentKeyPolicyFairPlayRentalAndLeaseKeyType { 119 return []ContentKeyPolicyFairPlayRentalAndLeaseKeyType{PersistentLimited, PersistentUnlimited, Undefined, Unknown} 120} 121 122// ContentKeyPolicyPlayReadyContentType enumerates the values for content key policy play ready content type. 123type ContentKeyPolicyPlayReadyContentType string 124 125const ( 126 // ContentKeyPolicyPlayReadyContentTypeUltraVioletDownload Ultraviolet download content type. 127 ContentKeyPolicyPlayReadyContentTypeUltraVioletDownload ContentKeyPolicyPlayReadyContentType = "UltraVioletDownload" 128 // ContentKeyPolicyPlayReadyContentTypeUltraVioletStreaming Ultraviolet streaming content type. 129 ContentKeyPolicyPlayReadyContentTypeUltraVioletStreaming ContentKeyPolicyPlayReadyContentType = "UltraVioletStreaming" 130 // ContentKeyPolicyPlayReadyContentTypeUnknown Represents a ContentKeyPolicyPlayReadyContentType that is 131 // unavailable in current API version. 132 ContentKeyPolicyPlayReadyContentTypeUnknown ContentKeyPolicyPlayReadyContentType = "Unknown" 133 // ContentKeyPolicyPlayReadyContentTypeUnspecified Unspecified content type. 134 ContentKeyPolicyPlayReadyContentTypeUnspecified ContentKeyPolicyPlayReadyContentType = "Unspecified" 135) 136 137// PossibleContentKeyPolicyPlayReadyContentTypeValues returns an array of possible values for the ContentKeyPolicyPlayReadyContentType const type. 138func PossibleContentKeyPolicyPlayReadyContentTypeValues() []ContentKeyPolicyPlayReadyContentType { 139 return []ContentKeyPolicyPlayReadyContentType{ContentKeyPolicyPlayReadyContentTypeUltraVioletDownload, ContentKeyPolicyPlayReadyContentTypeUltraVioletStreaming, ContentKeyPolicyPlayReadyContentTypeUnknown, ContentKeyPolicyPlayReadyContentTypeUnspecified} 140} 141 142// ContentKeyPolicyPlayReadyLicenseType enumerates the values for content key policy play ready license type. 143type ContentKeyPolicyPlayReadyLicenseType string 144 145const ( 146 // ContentKeyPolicyPlayReadyLicenseTypeNonPersistent Non persistent license. 147 ContentKeyPolicyPlayReadyLicenseTypeNonPersistent ContentKeyPolicyPlayReadyLicenseType = "NonPersistent" 148 // ContentKeyPolicyPlayReadyLicenseTypePersistent Persistent license. Allows offline playback. 149 ContentKeyPolicyPlayReadyLicenseTypePersistent ContentKeyPolicyPlayReadyLicenseType = "Persistent" 150 // ContentKeyPolicyPlayReadyLicenseTypeUnknown Represents a ContentKeyPolicyPlayReadyLicenseType that is 151 // unavailable in current API version. 152 ContentKeyPolicyPlayReadyLicenseTypeUnknown ContentKeyPolicyPlayReadyLicenseType = "Unknown" 153) 154 155// PossibleContentKeyPolicyPlayReadyLicenseTypeValues returns an array of possible values for the ContentKeyPolicyPlayReadyLicenseType const type. 156func PossibleContentKeyPolicyPlayReadyLicenseTypeValues() []ContentKeyPolicyPlayReadyLicenseType { 157 return []ContentKeyPolicyPlayReadyLicenseType{ContentKeyPolicyPlayReadyLicenseTypeNonPersistent, ContentKeyPolicyPlayReadyLicenseTypePersistent, ContentKeyPolicyPlayReadyLicenseTypeUnknown} 158} 159 160// ContentKeyPolicyPlayReadyUnknownOutputPassingOption enumerates the values for content key policy play ready 161// unknown output passing option. 162type ContentKeyPolicyPlayReadyUnknownOutputPassingOption string 163 164const ( 165 // ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowed Passing the video portion of protected 166 // content to an Unknown Output is allowed. 167 ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowed ContentKeyPolicyPlayReadyUnknownOutputPassingOption = "Allowed" 168 // ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowedWithVideoConstriction Passing the video 169 // portion of protected content to an Unknown Output is allowed but with constrained resolution. 170 ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowedWithVideoConstriction ContentKeyPolicyPlayReadyUnknownOutputPassingOption = "AllowedWithVideoConstriction" 171 // ContentKeyPolicyPlayReadyUnknownOutputPassingOptionNotAllowed Passing the video portion of protected 172 // content to an Unknown Output is not allowed. 173 ContentKeyPolicyPlayReadyUnknownOutputPassingOptionNotAllowed ContentKeyPolicyPlayReadyUnknownOutputPassingOption = "NotAllowed" 174 // ContentKeyPolicyPlayReadyUnknownOutputPassingOptionUnknown Represents a 175 // ContentKeyPolicyPlayReadyUnknownOutputPassingOption that is unavailable in current API version. 176 ContentKeyPolicyPlayReadyUnknownOutputPassingOptionUnknown ContentKeyPolicyPlayReadyUnknownOutputPassingOption = "Unknown" 177) 178 179// PossibleContentKeyPolicyPlayReadyUnknownOutputPassingOptionValues returns an array of possible values for the ContentKeyPolicyPlayReadyUnknownOutputPassingOption const type. 180func PossibleContentKeyPolicyPlayReadyUnknownOutputPassingOptionValues() []ContentKeyPolicyPlayReadyUnknownOutputPassingOption { 181 return []ContentKeyPolicyPlayReadyUnknownOutputPassingOption{ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowed, ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowedWithVideoConstriction, ContentKeyPolicyPlayReadyUnknownOutputPassingOptionNotAllowed, ContentKeyPolicyPlayReadyUnknownOutputPassingOptionUnknown} 182} 183 184// ContentKeyPolicyRestrictionTokenType enumerates the values for content key policy restriction token type. 185type ContentKeyPolicyRestrictionTokenType string 186 187const ( 188 // ContentKeyPolicyRestrictionTokenTypeJwt JSON Web Token. 189 ContentKeyPolicyRestrictionTokenTypeJwt ContentKeyPolicyRestrictionTokenType = "Jwt" 190 // ContentKeyPolicyRestrictionTokenTypeSwt Simple Web Token. 191 ContentKeyPolicyRestrictionTokenTypeSwt ContentKeyPolicyRestrictionTokenType = "Swt" 192 // ContentKeyPolicyRestrictionTokenTypeUnknown Represents a ContentKeyPolicyRestrictionTokenType that is 193 // unavailable in current API version. 194 ContentKeyPolicyRestrictionTokenTypeUnknown ContentKeyPolicyRestrictionTokenType = "Unknown" 195) 196 197// PossibleContentKeyPolicyRestrictionTokenTypeValues returns an array of possible values for the ContentKeyPolicyRestrictionTokenType const type. 198func PossibleContentKeyPolicyRestrictionTokenTypeValues() []ContentKeyPolicyRestrictionTokenType { 199 return []ContentKeyPolicyRestrictionTokenType{ContentKeyPolicyRestrictionTokenTypeJwt, ContentKeyPolicyRestrictionTokenTypeSwt, ContentKeyPolicyRestrictionTokenTypeUnknown} 200} 201 202// DeinterlaceMode enumerates the values for deinterlace mode. 203type DeinterlaceMode string 204 205const ( 206 // AutoPixelAdaptive Apply automatic pixel adaptive de-interlacing on each frame in the input video. 207 AutoPixelAdaptive DeinterlaceMode = "AutoPixelAdaptive" 208 // Off Disables de-interlacing of the source video. 209 Off DeinterlaceMode = "Off" 210) 211 212// PossibleDeinterlaceModeValues returns an array of possible values for the DeinterlaceMode const type. 213func PossibleDeinterlaceModeValues() []DeinterlaceMode { 214 return []DeinterlaceMode{AutoPixelAdaptive, Off} 215} 216 217// DeinterlaceParity enumerates the values for deinterlace parity. 218type DeinterlaceParity string 219 220const ( 221 // Auto Automatically detect the order of fields 222 Auto DeinterlaceParity = "Auto" 223 // BottomFieldFirst Apply bottom field first processing of input video. 224 BottomFieldFirst DeinterlaceParity = "BottomFieldFirst" 225 // TopFieldFirst Apply top field first processing of input video. 226 TopFieldFirst DeinterlaceParity = "TopFieldFirst" 227) 228 229// PossibleDeinterlaceParityValues returns an array of possible values for the DeinterlaceParity const type. 230func PossibleDeinterlaceParityValues() []DeinterlaceParity { 231 return []DeinterlaceParity{Auto, BottomFieldFirst, TopFieldFirst} 232} 233 234// EncoderNamedPreset enumerates the values for encoder named preset. 235type EncoderNamedPreset string 236 237const ( 238 // AACGoodQualityAudio Produces a single MP4 file containing only stereo audio encoded at 192 kbps. 239 AACGoodQualityAudio EncoderNamedPreset = "AACGoodQualityAudio" 240 // AdaptiveStreaming Produces a set of GOP aligned MP4 files with H.264 video and stereo AAC audio. 241 // Auto-generates a bitrate ladder based on the input resolution and bitrate. The auto-generated preset 242 // will never exceed the input resolution and bitrate. For example, if the input is 720p at 3 Mbps, output 243 // will remain 720p at best, and will start at rates lower than 3 Mbps. The output will have video and 244 // audio in separate MP4 files, which is optimal for adaptive streaming. 245 AdaptiveStreaming EncoderNamedPreset = "AdaptiveStreaming" 246 // ContentAwareEncodingExperimental Exposes an experimental preset for content-aware encoding. Given any 247 // input content, the service attempts to automatically determine the optimal number of layers, appropriate 248 // bitrate and resolution settings for delivery by adaptive streaming. The underlying algorithms will 249 // continue to evolve over time. The output will contain MP4 files with video and audio interleaved. 250 ContentAwareEncodingExperimental EncoderNamedPreset = "ContentAwareEncodingExperimental" 251 // H264MultipleBitrate1080p Produces a set of 8 GOP-aligned MP4 files, ranging from 6000 kbps to 400 kbps, 252 // and stereo AAC audio. Resolution starts at 1080p and goes down to 360p. 253 H264MultipleBitrate1080p EncoderNamedPreset = "H264MultipleBitrate1080p" 254 // H264MultipleBitrate720p Produces a set of 6 GOP-aligned MP4 files, ranging from 3400 kbps to 400 kbps, 255 // and stereo AAC audio. Resolution starts at 720p and goes down to 360p. 256 H264MultipleBitrate720p EncoderNamedPreset = "H264MultipleBitrate720p" 257 // H264MultipleBitrateSD Produces a set of 5 GOP-aligned MP4 files, ranging from 1600kbps to 400 kbps, and 258 // stereo AAC audio. Resolution starts at 480p and goes down to 360p. 259 H264MultipleBitrateSD EncoderNamedPreset = "H264MultipleBitrateSD" 260 // H264SingleBitrate1080p Produces an MP4 file where the video is encoded with H.264 codec at 6750 kbps and 261 // a picture height of 1080 pixels, and the stereo audio is encoded with AAC-LC codec at 64 kbps. 262 H264SingleBitrate1080p EncoderNamedPreset = "H264SingleBitrate1080p" 263 // H264SingleBitrate720p Produces an MP4 file where the video is encoded with H.264 codec at 4500 kbps and 264 // a picture height of 720 pixels, and the stereo audio is encoded with AAC-LC codec at 64 kbps. 265 H264SingleBitrate720p EncoderNamedPreset = "H264SingleBitrate720p" 266 // H264SingleBitrateSD Produces an MP4 file where the video is encoded with H.264 codec at 2200 kbps and a 267 // picture height of 480 pixels, and the stereo audio is encoded with AAC-LC codec at 64 kbps. 268 H264SingleBitrateSD EncoderNamedPreset = "H264SingleBitrateSD" 269) 270 271// PossibleEncoderNamedPresetValues returns an array of possible values for the EncoderNamedPreset const type. 272func PossibleEncoderNamedPresetValues() []EncoderNamedPreset { 273 return []EncoderNamedPreset{AACGoodQualityAudio, AdaptiveStreaming, ContentAwareEncodingExperimental, H264MultipleBitrate1080p, H264MultipleBitrate720p, H264MultipleBitrateSD, H264SingleBitrate1080p, H264SingleBitrate720p, H264SingleBitrateSD} 274} 275 276// EncryptionScheme enumerates the values for encryption scheme. 277type EncryptionScheme string 278 279const ( 280 // EncryptionSchemeCommonEncryptionCbcs CommonEncryptionCbcs scheme 281 EncryptionSchemeCommonEncryptionCbcs EncryptionScheme = "CommonEncryptionCbcs" 282 // EncryptionSchemeCommonEncryptionCenc CommonEncryptionCenc scheme 283 EncryptionSchemeCommonEncryptionCenc EncryptionScheme = "CommonEncryptionCenc" 284 // EncryptionSchemeEnvelopeEncryption EnvelopeEncryption scheme 285 EncryptionSchemeEnvelopeEncryption EncryptionScheme = "EnvelopeEncryption" 286 // EncryptionSchemeNoEncryption NoEncryption scheme 287 EncryptionSchemeNoEncryption EncryptionScheme = "NoEncryption" 288) 289 290// PossibleEncryptionSchemeValues returns an array of possible values for the EncryptionScheme const type. 291func PossibleEncryptionSchemeValues() []EncryptionScheme { 292 return []EncryptionScheme{EncryptionSchemeCommonEncryptionCbcs, EncryptionSchemeCommonEncryptionCenc, EncryptionSchemeEnvelopeEncryption, EncryptionSchemeNoEncryption} 293} 294 295// EntropyMode enumerates the values for entropy mode. 296type EntropyMode string 297 298const ( 299 // Cabac Context Adaptive Binary Arithmetic Coder (CABAC) entropy encoding. 300 Cabac EntropyMode = "Cabac" 301 // Cavlc Context Adaptive Variable Length Coder (CAVLC) entropy encoding. 302 Cavlc EntropyMode = "Cavlc" 303) 304 305// PossibleEntropyModeValues returns an array of possible values for the EntropyMode const type. 306func PossibleEntropyModeValues() []EntropyMode { 307 return []EntropyMode{Cabac, Cavlc} 308} 309 310// FilterTrackPropertyCompareOperation enumerates the values for filter track property compare operation. 311type FilterTrackPropertyCompareOperation string 312 313const ( 314 // Equal The equal operation. 315 Equal FilterTrackPropertyCompareOperation = "Equal" 316 // NotEqual The not equal operation. 317 NotEqual FilterTrackPropertyCompareOperation = "NotEqual" 318) 319 320// PossibleFilterTrackPropertyCompareOperationValues returns an array of possible values for the FilterTrackPropertyCompareOperation const type. 321func PossibleFilterTrackPropertyCompareOperationValues() []FilterTrackPropertyCompareOperation { 322 return []FilterTrackPropertyCompareOperation{Equal, NotEqual} 323} 324 325// FilterTrackPropertyType enumerates the values for filter track property type. 326type FilterTrackPropertyType string 327 328const ( 329 // FilterTrackPropertyTypeBitrate The bitrate. 330 FilterTrackPropertyTypeBitrate FilterTrackPropertyType = "Bitrate" 331 // FilterTrackPropertyTypeFourCC The fourCC. 332 FilterTrackPropertyTypeFourCC FilterTrackPropertyType = "FourCC" 333 // FilterTrackPropertyTypeLanguage The language. 334 FilterTrackPropertyTypeLanguage FilterTrackPropertyType = "Language" 335 // FilterTrackPropertyTypeName The name. 336 FilterTrackPropertyTypeName FilterTrackPropertyType = "Name" 337 // FilterTrackPropertyTypeType The type. 338 FilterTrackPropertyTypeType FilterTrackPropertyType = "Type" 339 // FilterTrackPropertyTypeUnknown The unknown track property type. 340 FilterTrackPropertyTypeUnknown FilterTrackPropertyType = "Unknown" 341) 342 343// PossibleFilterTrackPropertyTypeValues returns an array of possible values for the FilterTrackPropertyType const type. 344func PossibleFilterTrackPropertyTypeValues() []FilterTrackPropertyType { 345 return []FilterTrackPropertyType{FilterTrackPropertyTypeBitrate, FilterTrackPropertyTypeFourCC, FilterTrackPropertyTypeLanguage, FilterTrackPropertyTypeName, FilterTrackPropertyTypeType, FilterTrackPropertyTypeUnknown} 346} 347 348// H264Complexity enumerates the values for h264 complexity. 349type H264Complexity string 350 351const ( 352 // Balanced Tells the encoder to use settings that achieve a balance between speed and quality. 353 Balanced H264Complexity = "Balanced" 354 // Quality Tells the encoder to use settings that are optimized to produce higher quality output at the 355 // expense of slower overall encode time. 356 Quality H264Complexity = "Quality" 357 // Speed Tells the encoder to use settings that are optimized for faster encoding. Quality is sacrificed to 358 // decrease encoding time. 359 Speed H264Complexity = "Speed" 360) 361 362// PossibleH264ComplexityValues returns an array of possible values for the H264Complexity const type. 363func PossibleH264ComplexityValues() []H264Complexity { 364 return []H264Complexity{Balanced, Quality, Speed} 365} 366 367// H264VideoProfile enumerates the values for h264 video profile. 368type H264VideoProfile string 369 370const ( 371 // H264VideoProfileAuto Tells the encoder to automatically determine the appropriate H.264 profile. 372 H264VideoProfileAuto H264VideoProfile = "Auto" 373 // H264VideoProfileBaseline Baseline profile 374 H264VideoProfileBaseline H264VideoProfile = "Baseline" 375 // H264VideoProfileHigh High profile. 376 H264VideoProfileHigh H264VideoProfile = "High" 377 // H264VideoProfileHigh422 High 4:2:2 profile. 378 H264VideoProfileHigh422 H264VideoProfile = "High422" 379 // H264VideoProfileHigh444 High 4:4:4 predictive profile. 380 H264VideoProfileHigh444 H264VideoProfile = "High444" 381 // H264VideoProfileMain Main profile 382 H264VideoProfileMain H264VideoProfile = "Main" 383) 384 385// PossibleH264VideoProfileValues returns an array of possible values for the H264VideoProfile const type. 386func PossibleH264VideoProfileValues() []H264VideoProfile { 387 return []H264VideoProfile{H264VideoProfileAuto, H264VideoProfileBaseline, H264VideoProfileHigh, H264VideoProfileHigh422, H264VideoProfileHigh444, H264VideoProfileMain} 388} 389 390// InsightsType enumerates the values for insights type. 391type InsightsType string 392 393const ( 394 // AllInsights Generate both audio and video insights. Fails if either audio or video Insights fail. 395 AllInsights InsightsType = "AllInsights" 396 // AudioInsightsOnly Generate audio only insights. Ignore video even if present. Fails if no audio is 397 // present. 398 AudioInsightsOnly InsightsType = "AudioInsightsOnly" 399 // VideoInsightsOnly Generate video only insights. Ignore audio if present. Fails if no video is present. 400 VideoInsightsOnly InsightsType = "VideoInsightsOnly" 401) 402 403// PossibleInsightsTypeValues returns an array of possible values for the InsightsType const type. 404func PossibleInsightsTypeValues() []InsightsType { 405 return []InsightsType{AllInsights, AudioInsightsOnly, VideoInsightsOnly} 406} 407 408// JobErrorCategory enumerates the values for job error category. 409type JobErrorCategory string 410 411const ( 412 // JobErrorCategoryConfiguration The error is configuration related. 413 JobErrorCategoryConfiguration JobErrorCategory = "Configuration" 414 // JobErrorCategoryContent The error is related to data in the input files. 415 JobErrorCategoryContent JobErrorCategory = "Content" 416 // JobErrorCategoryDownload The error is download related. 417 JobErrorCategoryDownload JobErrorCategory = "Download" 418 // JobErrorCategoryService The error is service related. 419 JobErrorCategoryService JobErrorCategory = "Service" 420 // JobErrorCategoryUpload The error is upload related. 421 JobErrorCategoryUpload JobErrorCategory = "Upload" 422) 423 424// PossibleJobErrorCategoryValues returns an array of possible values for the JobErrorCategory const type. 425func PossibleJobErrorCategoryValues() []JobErrorCategory { 426 return []JobErrorCategory{JobErrorCategoryConfiguration, JobErrorCategoryContent, JobErrorCategoryDownload, JobErrorCategoryService, JobErrorCategoryUpload} 427} 428 429// JobErrorCode enumerates the values for job error code. 430type JobErrorCode string 431 432const ( 433 // ConfigurationUnsupported There was a problem with the combination of input files and the configuration 434 // settings applied, fix the configuration settings and retry with the same input, or change input to match 435 // the configuration. 436 ConfigurationUnsupported JobErrorCode = "ConfigurationUnsupported" 437 // ContentMalformed There was a problem with the input content (for example: zero byte files, or 438 // corrupt/non-decodable files), check the input files. 439 ContentMalformed JobErrorCode = "ContentMalformed" 440 // ContentUnsupported There was a problem with the format of the input (not valid media file, or an 441 // unsupported file/codec), check the validity of the input files. 442 ContentUnsupported JobErrorCode = "ContentUnsupported" 443 // DownloadNotAccessible While trying to download the input files, the files were not accessible, please 444 // check the availability of the source. 445 DownloadNotAccessible JobErrorCode = "DownloadNotAccessible" 446 // DownloadTransientError While trying to download the input files, there was an issue during transfer 447 // (storage service, network errors), see details and check your source. 448 DownloadTransientError JobErrorCode = "DownloadTransientError" 449 // ServiceError Fatal service error, please contact support. 450 ServiceError JobErrorCode = "ServiceError" 451 // ServiceTransientError Transient error, please retry, if retry is unsuccessful, please contact support. 452 ServiceTransientError JobErrorCode = "ServiceTransientError" 453 // UploadNotAccessible While trying to upload the output files, the destination was not reachable, please 454 // check the availability of the destination. 455 UploadNotAccessible JobErrorCode = "UploadNotAccessible" 456 // UploadTransientError While trying to upload the output files, there was an issue during transfer 457 // (storage service, network errors), see details and check your destination. 458 UploadTransientError JobErrorCode = "UploadTransientError" 459) 460 461// PossibleJobErrorCodeValues returns an array of possible values for the JobErrorCode const type. 462func PossibleJobErrorCodeValues() []JobErrorCode { 463 return []JobErrorCode{ConfigurationUnsupported, ContentMalformed, ContentUnsupported, DownloadNotAccessible, DownloadTransientError, ServiceError, ServiceTransientError, UploadNotAccessible, UploadTransientError} 464} 465 466// JobRetry enumerates the values for job retry. 467type JobRetry string 468 469const ( 470 // DoNotRetry Issue needs to be investigated and then the job resubmitted with corrections or retried once 471 // the underlying issue has been corrected. 472 DoNotRetry JobRetry = "DoNotRetry" 473 // MayRetry Issue may be resolved after waiting for a period of time and resubmitting the same Job. 474 MayRetry JobRetry = "MayRetry" 475) 476 477// PossibleJobRetryValues returns an array of possible values for the JobRetry const type. 478func PossibleJobRetryValues() []JobRetry { 479 return []JobRetry{DoNotRetry, MayRetry} 480} 481 482// JobState enumerates the values for job state. 483type JobState string 484 485const ( 486 // Canceled The job was canceled. This is a final state for the job. 487 Canceled JobState = "Canceled" 488 // Canceling The job is in the process of being canceled. This is a transient state for the job. 489 Canceling JobState = "Canceling" 490 // Error The job has encountered an error. This is a final state for the job. 491 Error JobState = "Error" 492 // Finished The job is finished. This is a final state for the job. 493 Finished JobState = "Finished" 494 // Processing The job is processing. This is a transient state for the job. 495 Processing JobState = "Processing" 496 // Queued The job is in a queued state, waiting for resources to become available. This is a transient 497 // state. 498 Queued JobState = "Queued" 499 // Scheduled The job is being scheduled to run on an available resource. This is a transient state, between 500 // queued and processing states. 501 Scheduled JobState = "Scheduled" 502) 503 504// PossibleJobStateValues returns an array of possible values for the JobState const type. 505func PossibleJobStateValues() []JobState { 506 return []JobState{Canceled, Canceling, Error, Finished, Processing, Queued, Scheduled} 507} 508 509// LiveEventEncodingType enumerates the values for live event encoding type. 510type LiveEventEncodingType string 511 512const ( 513 // LiveEventEncodingTypeBasic ... 514 LiveEventEncodingTypeBasic LiveEventEncodingType = "Basic" 515 // LiveEventEncodingTypeNone ... 516 LiveEventEncodingTypeNone LiveEventEncodingType = "None" 517 // LiveEventEncodingTypePremium1080p ... 518 LiveEventEncodingTypePremium1080p LiveEventEncodingType = "Premium1080p" 519 // LiveEventEncodingTypeStandard ... 520 LiveEventEncodingTypeStandard LiveEventEncodingType = "Standard" 521) 522 523// PossibleLiveEventEncodingTypeValues returns an array of possible values for the LiveEventEncodingType const type. 524func PossibleLiveEventEncodingTypeValues() []LiveEventEncodingType { 525 return []LiveEventEncodingType{LiveEventEncodingTypeBasic, LiveEventEncodingTypeNone, LiveEventEncodingTypePremium1080p, LiveEventEncodingTypeStandard} 526} 527 528// LiveEventInputProtocol enumerates the values for live event input protocol. 529type LiveEventInputProtocol string 530 531const ( 532 // FragmentedMP4 ... 533 FragmentedMP4 LiveEventInputProtocol = "FragmentedMP4" 534 // RTMP ... 535 RTMP LiveEventInputProtocol = "RTMP" 536) 537 538// PossibleLiveEventInputProtocolValues returns an array of possible values for the LiveEventInputProtocol const type. 539func PossibleLiveEventInputProtocolValues() []LiveEventInputProtocol { 540 return []LiveEventInputProtocol{FragmentedMP4, RTMP} 541} 542 543// LiveEventResourceState enumerates the values for live event resource state. 544type LiveEventResourceState string 545 546const ( 547 // Deleting ... 548 Deleting LiveEventResourceState = "Deleting" 549 // Running ... 550 Running LiveEventResourceState = "Running" 551 // Starting ... 552 Starting LiveEventResourceState = "Starting" 553 // Stopped ... 554 Stopped LiveEventResourceState = "Stopped" 555 // Stopping ... 556 Stopping LiveEventResourceState = "Stopping" 557) 558 559// PossibleLiveEventResourceStateValues returns an array of possible values for the LiveEventResourceState const type. 560func PossibleLiveEventResourceStateValues() []LiveEventResourceState { 561 return []LiveEventResourceState{Deleting, Running, Starting, Stopped, Stopping} 562} 563 564// LiveOutputResourceState enumerates the values for live output resource state. 565type LiveOutputResourceState string 566 567const ( 568 // LiveOutputResourceStateCreating ... 569 LiveOutputResourceStateCreating LiveOutputResourceState = "Creating" 570 // LiveOutputResourceStateDeleting ... 571 LiveOutputResourceStateDeleting LiveOutputResourceState = "Deleting" 572 // LiveOutputResourceStateRunning ... 573 LiveOutputResourceStateRunning LiveOutputResourceState = "Running" 574) 575 576// PossibleLiveOutputResourceStateValues returns an array of possible values for the LiveOutputResourceState const type. 577func PossibleLiveOutputResourceStateValues() []LiveOutputResourceState { 578 return []LiveOutputResourceState{LiveOutputResourceStateCreating, LiveOutputResourceStateDeleting, LiveOutputResourceStateRunning} 579} 580 581// MetricAggregationType enumerates the values for metric aggregation type. 582type MetricAggregationType string 583 584const ( 585 // Average The average. 586 Average MetricAggregationType = "Average" 587 // Count The count of a number of items, usually requests. 588 Count MetricAggregationType = "Count" 589 // Total The sum. 590 Total MetricAggregationType = "Total" 591) 592 593// PossibleMetricAggregationTypeValues returns an array of possible values for the MetricAggregationType const type. 594func PossibleMetricAggregationTypeValues() []MetricAggregationType { 595 return []MetricAggregationType{Average, Count, Total} 596} 597 598// MetricUnit enumerates the values for metric unit. 599type MetricUnit string 600 601const ( 602 // MetricUnitBytes The number of bytes. 603 MetricUnitBytes MetricUnit = "Bytes" 604 // MetricUnitCount The count. 605 MetricUnitCount MetricUnit = "Count" 606 // MetricUnitMilliseconds The number of milliseconds. 607 MetricUnitMilliseconds MetricUnit = "Milliseconds" 608) 609 610// PossibleMetricUnitValues returns an array of possible values for the MetricUnit const type. 611func PossibleMetricUnitValues() []MetricUnit { 612 return []MetricUnit{MetricUnitBytes, MetricUnitCount, MetricUnitMilliseconds} 613} 614 615// OdataType enumerates the values for odata type. 616type OdataType string 617 618const ( 619 // OdataTypeContentKeyPolicyPlayReadyContentKeyLocation ... 620 OdataTypeContentKeyPolicyPlayReadyContentKeyLocation OdataType = "ContentKeyPolicyPlayReadyContentKeyLocation" 621 // OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader ... 622 OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader OdataType = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader" 623 // OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier ... 624 OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier OdataType = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier" 625) 626 627// PossibleOdataTypeValues returns an array of possible values for the OdataType const type. 628func PossibleOdataTypeValues() []OdataType { 629 return []OdataType{OdataTypeContentKeyPolicyPlayReadyContentKeyLocation, OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier} 630} 631 632// OdataTypeBasicClipTime enumerates the values for odata type basic clip time. 633type OdataTypeBasicClipTime string 634 635const ( 636 // OdataTypeClipTime ... 637 OdataTypeClipTime OdataTypeBasicClipTime = "ClipTime" 638 // OdataTypeMicrosoftMediaAbsoluteClipTime ... 639 OdataTypeMicrosoftMediaAbsoluteClipTime OdataTypeBasicClipTime = "#Microsoft.Media.AbsoluteClipTime" 640) 641 642// PossibleOdataTypeBasicClipTimeValues returns an array of possible values for the OdataTypeBasicClipTime const type. 643func PossibleOdataTypeBasicClipTimeValues() []OdataTypeBasicClipTime { 644 return []OdataTypeBasicClipTime{OdataTypeClipTime, OdataTypeMicrosoftMediaAbsoluteClipTime} 645} 646 647// OdataTypeBasicCodec enumerates the values for odata type basic codec. 648type OdataTypeBasicCodec string 649 650const ( 651 // OdataTypeCodec ... 652 OdataTypeCodec OdataTypeBasicCodec = "Codec" 653 // OdataTypeMicrosoftMediaAacAudio ... 654 OdataTypeMicrosoftMediaAacAudio OdataTypeBasicCodec = "#Microsoft.Media.AacAudio" 655 // OdataTypeMicrosoftMediaAudio ... 656 OdataTypeMicrosoftMediaAudio OdataTypeBasicCodec = "#Microsoft.Media.Audio" 657 // OdataTypeMicrosoftMediaCopyAudio ... 658 OdataTypeMicrosoftMediaCopyAudio OdataTypeBasicCodec = "#Microsoft.Media.CopyAudio" 659 // OdataTypeMicrosoftMediaCopyVideo ... 660 OdataTypeMicrosoftMediaCopyVideo OdataTypeBasicCodec = "#Microsoft.Media.CopyVideo" 661 // OdataTypeMicrosoftMediaH264Video ... 662 OdataTypeMicrosoftMediaH264Video OdataTypeBasicCodec = "#Microsoft.Media.H264Video" 663 // OdataTypeMicrosoftMediaImage ... 664 OdataTypeMicrosoftMediaImage OdataTypeBasicCodec = "#Microsoft.Media.Image" 665 // OdataTypeMicrosoftMediaJpgImage ... 666 OdataTypeMicrosoftMediaJpgImage OdataTypeBasicCodec = "#Microsoft.Media.JpgImage" 667 // OdataTypeMicrosoftMediaPngImage ... 668 OdataTypeMicrosoftMediaPngImage OdataTypeBasicCodec = "#Microsoft.Media.PngImage" 669 // OdataTypeMicrosoftMediaVideo ... 670 OdataTypeMicrosoftMediaVideo OdataTypeBasicCodec = "#Microsoft.Media.Video" 671) 672 673// PossibleOdataTypeBasicCodecValues returns an array of possible values for the OdataTypeBasicCodec const type. 674func PossibleOdataTypeBasicCodecValues() []OdataTypeBasicCodec { 675 return []OdataTypeBasicCodec{OdataTypeCodec, OdataTypeMicrosoftMediaAacAudio, OdataTypeMicrosoftMediaAudio, OdataTypeMicrosoftMediaCopyAudio, OdataTypeMicrosoftMediaCopyVideo, OdataTypeMicrosoftMediaH264Video, OdataTypeMicrosoftMediaImage, OdataTypeMicrosoftMediaJpgImage, OdataTypeMicrosoftMediaPngImage, OdataTypeMicrosoftMediaVideo} 676} 677 678// OdataTypeBasicContentKeyPolicyConfiguration enumerates the values for odata type basic content key policy 679// configuration. 680type OdataTypeBasicContentKeyPolicyConfiguration string 681 682const ( 683 // OdataTypeContentKeyPolicyConfiguration ... 684 OdataTypeContentKeyPolicyConfiguration OdataTypeBasicContentKeyPolicyConfiguration = "ContentKeyPolicyConfiguration" 685 // OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration ... 686 OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration OdataTypeBasicContentKeyPolicyConfiguration = "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration" 687 // OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration ... 688 OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration OdataTypeBasicContentKeyPolicyConfiguration = "#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration" 689 // OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration ... 690 OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration OdataTypeBasicContentKeyPolicyConfiguration = "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration" 691 // OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration ... 692 OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration OdataTypeBasicContentKeyPolicyConfiguration = "#Microsoft.Media.ContentKeyPolicyUnknownConfiguration" 693 // OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration ... 694 OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration OdataTypeBasicContentKeyPolicyConfiguration = "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration" 695) 696 697// PossibleOdataTypeBasicContentKeyPolicyConfigurationValues returns an array of possible values for the OdataTypeBasicContentKeyPolicyConfiguration const type. 698func PossibleOdataTypeBasicContentKeyPolicyConfigurationValues() []OdataTypeBasicContentKeyPolicyConfiguration { 699 return []OdataTypeBasicContentKeyPolicyConfiguration{OdataTypeContentKeyPolicyConfiguration, OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration, OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration, OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration, OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration, OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration} 700} 701 702// OdataTypeBasicContentKeyPolicyRestriction enumerates the values for odata type basic content key policy 703// restriction. 704type OdataTypeBasicContentKeyPolicyRestriction string 705 706const ( 707 // OdataTypeContentKeyPolicyRestriction ... 708 OdataTypeContentKeyPolicyRestriction OdataTypeBasicContentKeyPolicyRestriction = "ContentKeyPolicyRestriction" 709 // OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction ... 710 OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction OdataTypeBasicContentKeyPolicyRestriction = "#Microsoft.Media.ContentKeyPolicyOpenRestriction" 711 // OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction ... 712 OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction OdataTypeBasicContentKeyPolicyRestriction = "#Microsoft.Media.ContentKeyPolicyTokenRestriction" 713 // OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction ... 714 OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction OdataTypeBasicContentKeyPolicyRestriction = "#Microsoft.Media.ContentKeyPolicyUnknownRestriction" 715) 716 717// PossibleOdataTypeBasicContentKeyPolicyRestrictionValues returns an array of possible values for the OdataTypeBasicContentKeyPolicyRestriction const type. 718func PossibleOdataTypeBasicContentKeyPolicyRestrictionValues() []OdataTypeBasicContentKeyPolicyRestriction { 719 return []OdataTypeBasicContentKeyPolicyRestriction{OdataTypeContentKeyPolicyRestriction, OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction, OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction, OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction} 720} 721 722// OdataTypeBasicContentKeyPolicyRestrictionTokenKey enumerates the values for odata type basic content key 723// policy restriction token key. 724type OdataTypeBasicContentKeyPolicyRestrictionTokenKey string 725 726const ( 727 // OdataTypeContentKeyPolicyRestrictionTokenKey ... 728 OdataTypeContentKeyPolicyRestrictionTokenKey OdataTypeBasicContentKeyPolicyRestrictionTokenKey = "ContentKeyPolicyRestrictionTokenKey" 729 // OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey ... 730 OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey OdataTypeBasicContentKeyPolicyRestrictionTokenKey = "#Microsoft.Media.ContentKeyPolicyRsaTokenKey" 731 // OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey ... 732 OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey OdataTypeBasicContentKeyPolicyRestrictionTokenKey = "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey" 733 // OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey ... 734 OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey OdataTypeBasicContentKeyPolicyRestrictionTokenKey = "#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey" 735) 736 737// PossibleOdataTypeBasicContentKeyPolicyRestrictionTokenKeyValues returns an array of possible values for the OdataTypeBasicContentKeyPolicyRestrictionTokenKey const type. 738func PossibleOdataTypeBasicContentKeyPolicyRestrictionTokenKeyValues() []OdataTypeBasicContentKeyPolicyRestrictionTokenKey { 739 return []OdataTypeBasicContentKeyPolicyRestrictionTokenKey{OdataTypeContentKeyPolicyRestrictionTokenKey, OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey, OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey, OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey} 740} 741 742// OdataTypeBasicFormat enumerates the values for odata type basic format. 743type OdataTypeBasicFormat string 744 745const ( 746 // OdataTypeFormat ... 747 OdataTypeFormat OdataTypeBasicFormat = "Format" 748 // OdataTypeMicrosoftMediaImageFormat ... 749 OdataTypeMicrosoftMediaImageFormat OdataTypeBasicFormat = "#Microsoft.Media.ImageFormat" 750 // OdataTypeMicrosoftMediaJpgFormat ... 751 OdataTypeMicrosoftMediaJpgFormat OdataTypeBasicFormat = "#Microsoft.Media.JpgFormat" 752 // OdataTypeMicrosoftMediaMp4Format ... 753 OdataTypeMicrosoftMediaMp4Format OdataTypeBasicFormat = "#Microsoft.Media.Mp4Format" 754 // OdataTypeMicrosoftMediaMultiBitrateFormat ... 755 OdataTypeMicrosoftMediaMultiBitrateFormat OdataTypeBasicFormat = "#Microsoft.Media.MultiBitrateFormat" 756 // OdataTypeMicrosoftMediaPngFormat ... 757 OdataTypeMicrosoftMediaPngFormat OdataTypeBasicFormat = "#Microsoft.Media.PngFormat" 758 // OdataTypeMicrosoftMediaTransportStreamFormat ... 759 OdataTypeMicrosoftMediaTransportStreamFormat OdataTypeBasicFormat = "#Microsoft.Media.TransportStreamFormat" 760) 761 762// PossibleOdataTypeBasicFormatValues returns an array of possible values for the OdataTypeBasicFormat const type. 763func PossibleOdataTypeBasicFormatValues() []OdataTypeBasicFormat { 764 return []OdataTypeBasicFormat{OdataTypeFormat, OdataTypeMicrosoftMediaImageFormat, OdataTypeMicrosoftMediaJpgFormat, OdataTypeMicrosoftMediaMp4Format, OdataTypeMicrosoftMediaMultiBitrateFormat, OdataTypeMicrosoftMediaPngFormat, OdataTypeMicrosoftMediaTransportStreamFormat} 765} 766 767// OdataTypeBasicJobInput enumerates the values for odata type basic job input. 768type OdataTypeBasicJobInput string 769 770const ( 771 // OdataTypeJobInput ... 772 OdataTypeJobInput OdataTypeBasicJobInput = "JobInput" 773 // OdataTypeMicrosoftMediaJobInputAsset ... 774 OdataTypeMicrosoftMediaJobInputAsset OdataTypeBasicJobInput = "#Microsoft.Media.JobInputAsset" 775 // OdataTypeMicrosoftMediaJobInputClip ... 776 OdataTypeMicrosoftMediaJobInputClip OdataTypeBasicJobInput = "#Microsoft.Media.JobInputClip" 777 // OdataTypeMicrosoftMediaJobInputHTTP ... 778 OdataTypeMicrosoftMediaJobInputHTTP OdataTypeBasicJobInput = "#Microsoft.Media.JobInputHttp" 779 // OdataTypeMicrosoftMediaJobInputs ... 780 OdataTypeMicrosoftMediaJobInputs OdataTypeBasicJobInput = "#Microsoft.Media.JobInputs" 781) 782 783// PossibleOdataTypeBasicJobInputValues returns an array of possible values for the OdataTypeBasicJobInput const type. 784func PossibleOdataTypeBasicJobInputValues() []OdataTypeBasicJobInput { 785 return []OdataTypeBasicJobInput{OdataTypeJobInput, OdataTypeMicrosoftMediaJobInputAsset, OdataTypeMicrosoftMediaJobInputClip, OdataTypeMicrosoftMediaJobInputHTTP, OdataTypeMicrosoftMediaJobInputs} 786} 787 788// OdataTypeBasicJobOutput enumerates the values for odata type basic job output. 789type OdataTypeBasicJobOutput string 790 791const ( 792 // OdataTypeJobOutput ... 793 OdataTypeJobOutput OdataTypeBasicJobOutput = "JobOutput" 794 // OdataTypeMicrosoftMediaJobOutputAsset ... 795 OdataTypeMicrosoftMediaJobOutputAsset OdataTypeBasicJobOutput = "#Microsoft.Media.JobOutputAsset" 796) 797 798// PossibleOdataTypeBasicJobOutputValues returns an array of possible values for the OdataTypeBasicJobOutput const type. 799func PossibleOdataTypeBasicJobOutputValues() []OdataTypeBasicJobOutput { 800 return []OdataTypeBasicJobOutput{OdataTypeJobOutput, OdataTypeMicrosoftMediaJobOutputAsset} 801} 802 803// OdataTypeBasicLayer enumerates the values for odata type basic layer. 804type OdataTypeBasicLayer string 805 806const ( 807 // OdataTypeLayer ... 808 OdataTypeLayer OdataTypeBasicLayer = "Layer" 809 // OdataTypeMicrosoftMediaH264Layer ... 810 OdataTypeMicrosoftMediaH264Layer OdataTypeBasicLayer = "#Microsoft.Media.H264Layer" 811 // OdataTypeMicrosoftMediaJpgLayer ... 812 OdataTypeMicrosoftMediaJpgLayer OdataTypeBasicLayer = "#Microsoft.Media.JpgLayer" 813 // OdataTypeMicrosoftMediaPngLayer ... 814 OdataTypeMicrosoftMediaPngLayer OdataTypeBasicLayer = "#Microsoft.Media.PngLayer" 815 // OdataTypeMicrosoftMediaVideoLayer ... 816 OdataTypeMicrosoftMediaVideoLayer OdataTypeBasicLayer = "#Microsoft.Media.VideoLayer" 817) 818 819// PossibleOdataTypeBasicLayerValues returns an array of possible values for the OdataTypeBasicLayer const type. 820func PossibleOdataTypeBasicLayerValues() []OdataTypeBasicLayer { 821 return []OdataTypeBasicLayer{OdataTypeLayer, OdataTypeMicrosoftMediaH264Layer, OdataTypeMicrosoftMediaJpgLayer, OdataTypeMicrosoftMediaPngLayer, OdataTypeMicrosoftMediaVideoLayer} 822} 823 824// OdataTypeBasicOverlay enumerates the values for odata type basic overlay. 825type OdataTypeBasicOverlay string 826 827const ( 828 // OdataTypeMicrosoftMediaAudioOverlay ... 829 OdataTypeMicrosoftMediaAudioOverlay OdataTypeBasicOverlay = "#Microsoft.Media.AudioOverlay" 830 // OdataTypeMicrosoftMediaVideoOverlay ... 831 OdataTypeMicrosoftMediaVideoOverlay OdataTypeBasicOverlay = "#Microsoft.Media.VideoOverlay" 832 // OdataTypeOverlay ... 833 OdataTypeOverlay OdataTypeBasicOverlay = "Overlay" 834) 835 836// PossibleOdataTypeBasicOverlayValues returns an array of possible values for the OdataTypeBasicOverlay const type. 837func PossibleOdataTypeBasicOverlayValues() []OdataTypeBasicOverlay { 838 return []OdataTypeBasicOverlay{OdataTypeMicrosoftMediaAudioOverlay, OdataTypeMicrosoftMediaVideoOverlay, OdataTypeOverlay} 839} 840 841// OdataTypeBasicPreset enumerates the values for odata type basic preset. 842type OdataTypeBasicPreset string 843 844const ( 845 // OdataTypeMicrosoftMediaAudioAnalyzerPreset ... 846 OdataTypeMicrosoftMediaAudioAnalyzerPreset OdataTypeBasicPreset = "#Microsoft.Media.AudioAnalyzerPreset" 847 // OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset ... 848 OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset OdataTypeBasicPreset = "#Microsoft.Media.BuiltInStandardEncoderPreset" 849 // OdataTypeMicrosoftMediaFaceDetectorPreset ... 850 OdataTypeMicrosoftMediaFaceDetectorPreset OdataTypeBasicPreset = "#Microsoft.Media.FaceDetectorPreset" 851 // OdataTypeMicrosoftMediaStandardEncoderPreset ... 852 OdataTypeMicrosoftMediaStandardEncoderPreset OdataTypeBasicPreset = "#Microsoft.Media.StandardEncoderPreset" 853 // OdataTypeMicrosoftMediaVideoAnalyzerPreset ... 854 OdataTypeMicrosoftMediaVideoAnalyzerPreset OdataTypeBasicPreset = "#Microsoft.Media.VideoAnalyzerPreset" 855 // OdataTypePreset ... 856 OdataTypePreset OdataTypeBasicPreset = "Preset" 857) 858 859// PossibleOdataTypeBasicPresetValues returns an array of possible values for the OdataTypeBasicPreset const type. 860func PossibleOdataTypeBasicPresetValues() []OdataTypeBasicPreset { 861 return []OdataTypeBasicPreset{OdataTypeMicrosoftMediaAudioAnalyzerPreset, OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset, OdataTypeMicrosoftMediaFaceDetectorPreset, OdataTypeMicrosoftMediaStandardEncoderPreset, OdataTypeMicrosoftMediaVideoAnalyzerPreset, OdataTypePreset} 862} 863 864// OnErrorType enumerates the values for on error type. 865type OnErrorType string 866 867const ( 868 // ContinueJob Tells the service that if this TransformOutput fails, then allow any other TransformOutput 869 // to continue. 870 ContinueJob OnErrorType = "ContinueJob" 871 // StopProcessingJob Tells the service that if this TransformOutput fails, then any other incomplete 872 // TransformOutputs can be stopped. 873 StopProcessingJob OnErrorType = "StopProcessingJob" 874) 875 876// PossibleOnErrorTypeValues returns an array of possible values for the OnErrorType const type. 877func PossibleOnErrorTypeValues() []OnErrorType { 878 return []OnErrorType{ContinueJob, StopProcessingJob} 879} 880 881// Priority enumerates the values for priority. 882type Priority string 883 884const ( 885 // High Used for TransformOutputs that should take precedence over others. 886 High Priority = "High" 887 // Low Used for TransformOutputs that can be generated after Normal and High priority TransformOutputs. 888 Low Priority = "Low" 889 // Normal Used for TransformOutputs that can be generated at Normal priority. 890 Normal Priority = "Normal" 891) 892 893// PossiblePriorityValues returns an array of possible values for the Priority const type. 894func PossiblePriorityValues() []Priority { 895 return []Priority{High, Low, Normal} 896} 897 898// Rotation enumerates the values for rotation. 899type Rotation string 900 901const ( 902 // RotationAuto Automatically detect and rotate as needed. 903 RotationAuto Rotation = "Auto" 904 // RotationNone Do not rotate the video. If the output format supports it, any metadata about rotation is 905 // kept intact. 906 RotationNone Rotation = "None" 907 // RotationRotate0 Do not rotate the video but remove any metadata about the rotation. 908 RotationRotate0 Rotation = "Rotate0" 909 // RotationRotate180 Rotate 180 degrees clockwise. 910 RotationRotate180 Rotation = "Rotate180" 911 // RotationRotate270 Rotate 270 degrees clockwise. 912 RotationRotate270 Rotation = "Rotate270" 913 // RotationRotate90 Rotate 90 degrees clockwise. 914 RotationRotate90 Rotation = "Rotate90" 915) 916 917// PossibleRotationValues returns an array of possible values for the Rotation const type. 918func PossibleRotationValues() []Rotation { 919 return []Rotation{RotationAuto, RotationNone, RotationRotate0, RotationRotate180, RotationRotate270, RotationRotate90} 920} 921 922// StorageAccountType enumerates the values for storage account type. 923type StorageAccountType string 924 925const ( 926 // Primary The primary storage account for the Media Services account. 927 Primary StorageAccountType = "Primary" 928 // Secondary A secondary storage account for the Media Services account. 929 Secondary StorageAccountType = "Secondary" 930) 931 932// PossibleStorageAccountTypeValues returns an array of possible values for the StorageAccountType const type. 933func PossibleStorageAccountTypeValues() []StorageAccountType { 934 return []StorageAccountType{Primary, Secondary} 935} 936 937// StreamingEndpointResourceState enumerates the values for streaming endpoint resource state. 938type StreamingEndpointResourceState string 939 940const ( 941 // StreamingEndpointResourceStateDeleting ... 942 StreamingEndpointResourceStateDeleting StreamingEndpointResourceState = "Deleting" 943 // StreamingEndpointResourceStateRunning ... 944 StreamingEndpointResourceStateRunning StreamingEndpointResourceState = "Running" 945 // StreamingEndpointResourceStateScaling ... 946 StreamingEndpointResourceStateScaling StreamingEndpointResourceState = "Scaling" 947 // StreamingEndpointResourceStateStarting ... 948 StreamingEndpointResourceStateStarting StreamingEndpointResourceState = "Starting" 949 // StreamingEndpointResourceStateStopped ... 950 StreamingEndpointResourceStateStopped StreamingEndpointResourceState = "Stopped" 951 // StreamingEndpointResourceStateStopping ... 952 StreamingEndpointResourceStateStopping StreamingEndpointResourceState = "Stopping" 953) 954 955// PossibleStreamingEndpointResourceStateValues returns an array of possible values for the StreamingEndpointResourceState const type. 956func PossibleStreamingEndpointResourceStateValues() []StreamingEndpointResourceState { 957 return []StreamingEndpointResourceState{StreamingEndpointResourceStateDeleting, StreamingEndpointResourceStateRunning, StreamingEndpointResourceStateScaling, StreamingEndpointResourceStateStarting, StreamingEndpointResourceStateStopped, StreamingEndpointResourceStateStopping} 958} 959 960// StreamingLocatorContentKeyType enumerates the values for streaming locator content key type. 961type StreamingLocatorContentKeyType string 962 963const ( 964 // StreamingLocatorContentKeyTypeCommonEncryptionCbcs Common Encryption using CBCS 965 StreamingLocatorContentKeyTypeCommonEncryptionCbcs StreamingLocatorContentKeyType = "CommonEncryptionCbcs" 966 // StreamingLocatorContentKeyTypeCommonEncryptionCenc Common Encryption using CENC 967 StreamingLocatorContentKeyTypeCommonEncryptionCenc StreamingLocatorContentKeyType = "CommonEncryptionCenc" 968 // StreamingLocatorContentKeyTypeEnvelopeEncryption Envelope Encryption 969 StreamingLocatorContentKeyTypeEnvelopeEncryption StreamingLocatorContentKeyType = "EnvelopeEncryption" 970) 971 972// PossibleStreamingLocatorContentKeyTypeValues returns an array of possible values for the StreamingLocatorContentKeyType const type. 973func PossibleStreamingLocatorContentKeyTypeValues() []StreamingLocatorContentKeyType { 974 return []StreamingLocatorContentKeyType{StreamingLocatorContentKeyTypeCommonEncryptionCbcs, StreamingLocatorContentKeyTypeCommonEncryptionCenc, StreamingLocatorContentKeyTypeEnvelopeEncryption} 975} 976 977// StreamingPolicyStreamingProtocol enumerates the values for streaming policy streaming protocol. 978type StreamingPolicyStreamingProtocol string 979 980const ( 981 // StreamingPolicyStreamingProtocolDash DASH protocol 982 StreamingPolicyStreamingProtocolDash StreamingPolicyStreamingProtocol = "Dash" 983 // StreamingPolicyStreamingProtocolDownload Download protocol 984 StreamingPolicyStreamingProtocolDownload StreamingPolicyStreamingProtocol = "Download" 985 // StreamingPolicyStreamingProtocolHls HLS protocol 986 StreamingPolicyStreamingProtocolHls StreamingPolicyStreamingProtocol = "Hls" 987 // StreamingPolicyStreamingProtocolSmoothStreaming SmoothStreaming protocol 988 StreamingPolicyStreamingProtocolSmoothStreaming StreamingPolicyStreamingProtocol = "SmoothStreaming" 989) 990 991// PossibleStreamingPolicyStreamingProtocolValues returns an array of possible values for the StreamingPolicyStreamingProtocol const type. 992func PossibleStreamingPolicyStreamingProtocolValues() []StreamingPolicyStreamingProtocol { 993 return []StreamingPolicyStreamingProtocol{StreamingPolicyStreamingProtocolDash, StreamingPolicyStreamingProtocolDownload, StreamingPolicyStreamingProtocolHls, StreamingPolicyStreamingProtocolSmoothStreaming} 994} 995 996// StreamOptionsFlag enumerates the values for stream options flag. 997type StreamOptionsFlag string 998 999const ( 1000 // Default ... 1001 Default StreamOptionsFlag = "Default" 1002 // LowLatency ... 1003 LowLatency StreamOptionsFlag = "LowLatency" 1004) 1005 1006// PossibleStreamOptionsFlagValues returns an array of possible values for the StreamOptionsFlag const type. 1007func PossibleStreamOptionsFlagValues() []StreamOptionsFlag { 1008 return []StreamOptionsFlag{Default, LowLatency} 1009} 1010 1011// StretchMode enumerates the values for stretch mode. 1012type StretchMode string 1013 1014const ( 1015 // StretchModeAutoFit Pad the output (with either letterbox or pillar box) to honor the output resolution, 1016 // while ensuring that the active video region in the output has the same aspect ratio as the input. For 1017 // example, if the input is 1920x1080 and the encoding preset asks for 1280x1280, then the output will be 1018 // at 1280x1280, which contains an inner rectangle of 1280x720 at aspect ratio of 16:9, and pillar box 1019 // regions 280 pixels wide at the left and right. 1020 StretchModeAutoFit StretchMode = "AutoFit" 1021 // StretchModeAutoSize Override the output resolution, and change it to match the display aspect ratio of 1022 // the input, without padding. For example, if the input is 1920x1080 and the encoding preset asks for 1023 // 1280x1280, then the value in the preset is overridden, and the output will be at 1280x720, which 1024 // maintains the input aspect ratio of 16:9. 1025 StretchModeAutoSize StretchMode = "AutoSize" 1026 // StretchModeNone Strictly respect the output resolution without considering the pixel aspect ratio or 1027 // display aspect ratio of the input video. 1028 StretchModeNone StretchMode = "None" 1029) 1030 1031// PossibleStretchModeValues returns an array of possible values for the StretchMode const type. 1032func PossibleStretchModeValues() []StretchMode { 1033 return []StretchMode{StretchModeAutoFit, StretchModeAutoSize, StretchModeNone} 1034} 1035 1036// TrackPropertyCompareOperation enumerates the values for track property compare operation. 1037type TrackPropertyCompareOperation string 1038 1039const ( 1040 // TrackPropertyCompareOperationEqual Equal operation 1041 TrackPropertyCompareOperationEqual TrackPropertyCompareOperation = "Equal" 1042 // TrackPropertyCompareOperationUnknown Unknown track property compare operation 1043 TrackPropertyCompareOperationUnknown TrackPropertyCompareOperation = "Unknown" 1044) 1045 1046// PossibleTrackPropertyCompareOperationValues returns an array of possible values for the TrackPropertyCompareOperation const type. 1047func PossibleTrackPropertyCompareOperationValues() []TrackPropertyCompareOperation { 1048 return []TrackPropertyCompareOperation{TrackPropertyCompareOperationEqual, TrackPropertyCompareOperationUnknown} 1049} 1050 1051// TrackPropertyType enumerates the values for track property type. 1052type TrackPropertyType string 1053 1054const ( 1055 // TrackPropertyTypeFourCC Track FourCC 1056 TrackPropertyTypeFourCC TrackPropertyType = "FourCC" 1057 // TrackPropertyTypeUnknown Unknown track property 1058 TrackPropertyTypeUnknown TrackPropertyType = "Unknown" 1059) 1060 1061// PossibleTrackPropertyTypeValues returns an array of possible values for the TrackPropertyType const type. 1062func PossibleTrackPropertyTypeValues() []TrackPropertyType { 1063 return []TrackPropertyType{TrackPropertyTypeFourCC, TrackPropertyTypeUnknown} 1064} 1065 1066// AacAudio describes Advanced Audio Codec (AAC) audio encoding settings. 1067type AacAudio struct { 1068 // Profile - The encoding profile to be used when encoding audio with AAC. Possible values include: 'AacLc', 'HeAacV1', 'HeAacV2' 1069 Profile AacAudioProfile `json:"profile,omitempty"` 1070 // Channels - The number of channels in the audio. 1071 Channels *int32 `json:"channels,omitempty"` 1072 // SamplingRate - The sampling rate to use for encoding in hertz. 1073 SamplingRate *int32 `json:"samplingRate,omitempty"` 1074 // Bitrate - The bitrate, in bits per second, of the output encoded audio. 1075 Bitrate *int32 `json:"bitrate,omitempty"` 1076 // Label - An optional label for the codec. The label can be used to control muxing behavior. 1077 Label *string `json:"label,omitempty"` 1078 // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' 1079 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` 1080} 1081 1082// MarshalJSON is the custom marshaler for AacAudio. 1083func (aa AacAudio) MarshalJSON() ([]byte, error) { 1084 aa.OdataType = OdataTypeMicrosoftMediaAacAudio 1085 objectMap := make(map[string]interface{}) 1086 if aa.Profile != "" { 1087 objectMap["profile"] = aa.Profile 1088 } 1089 if aa.Channels != nil { 1090 objectMap["channels"] = aa.Channels 1091 } 1092 if aa.SamplingRate != nil { 1093 objectMap["samplingRate"] = aa.SamplingRate 1094 } 1095 if aa.Bitrate != nil { 1096 objectMap["bitrate"] = aa.Bitrate 1097 } 1098 if aa.Label != nil { 1099 objectMap["label"] = aa.Label 1100 } 1101 if aa.OdataType != "" { 1102 objectMap["@odata.type"] = aa.OdataType 1103 } 1104 return json.Marshal(objectMap) 1105} 1106 1107// AsAudio is the BasicCodec implementation for AacAudio. 1108func (aa AacAudio) AsAudio() (*Audio, bool) { 1109 return nil, false 1110} 1111 1112// AsBasicAudio is the BasicCodec implementation for AacAudio. 1113func (aa AacAudio) AsBasicAudio() (BasicAudio, bool) { 1114 return &aa, true 1115} 1116 1117// AsAacAudio is the BasicCodec implementation for AacAudio. 1118func (aa AacAudio) AsAacAudio() (*AacAudio, bool) { 1119 return &aa, true 1120} 1121 1122// AsCopyVideo is the BasicCodec implementation for AacAudio. 1123func (aa AacAudio) AsCopyVideo() (*CopyVideo, bool) { 1124 return nil, false 1125} 1126 1127// AsVideo is the BasicCodec implementation for AacAudio. 1128func (aa AacAudio) AsVideo() (*Video, bool) { 1129 return nil, false 1130} 1131 1132// AsBasicVideo is the BasicCodec implementation for AacAudio. 1133func (aa AacAudio) AsBasicVideo() (BasicVideo, bool) { 1134 return nil, false 1135} 1136 1137// AsImage is the BasicCodec implementation for AacAudio. 1138func (aa AacAudio) AsImage() (*Image, bool) { 1139 return nil, false 1140} 1141 1142// AsBasicImage is the BasicCodec implementation for AacAudio. 1143func (aa AacAudio) AsBasicImage() (BasicImage, bool) { 1144 return nil, false 1145} 1146 1147// AsCopyAudio is the BasicCodec implementation for AacAudio. 1148func (aa AacAudio) AsCopyAudio() (*CopyAudio, bool) { 1149 return nil, false 1150} 1151 1152// AsH264Video is the BasicCodec implementation for AacAudio. 1153func (aa AacAudio) AsH264Video() (*H264Video, bool) { 1154 return nil, false 1155} 1156 1157// AsJpgImage is the BasicCodec implementation for AacAudio. 1158func (aa AacAudio) AsJpgImage() (*JpgImage, bool) { 1159 return nil, false 1160} 1161 1162// AsPngImage is the BasicCodec implementation for AacAudio. 1163func (aa AacAudio) AsPngImage() (*PngImage, bool) { 1164 return nil, false 1165} 1166 1167// AsCodec is the BasicCodec implementation for AacAudio. 1168func (aa AacAudio) AsCodec() (*Codec, bool) { 1169 return nil, false 1170} 1171 1172// AsBasicCodec is the BasicCodec implementation for AacAudio. 1173func (aa AacAudio) AsBasicCodec() (BasicCodec, bool) { 1174 return &aa, true 1175} 1176 1177// AbsoluteClipTime specifies the clip time as an absolute time position in the media file. The absolute 1178// time can point to a different position depending on whether the media file starts from a timestamp of 1179// zero or not. 1180type AbsoluteClipTime struct { 1181 // Time - The time position on the timeline of the input media. It is usually specified as an ISO8601 period. e.g PT30S for 30 seconds. 1182 Time *string `json:"time,omitempty"` 1183 // OdataType - Possible values include: 'OdataTypeClipTime', 'OdataTypeMicrosoftMediaAbsoluteClipTime' 1184 OdataType OdataTypeBasicClipTime `json:"@odata.type,omitempty"` 1185} 1186 1187// MarshalJSON is the custom marshaler for AbsoluteClipTime. 1188func (act AbsoluteClipTime) MarshalJSON() ([]byte, error) { 1189 act.OdataType = OdataTypeMicrosoftMediaAbsoluteClipTime 1190 objectMap := make(map[string]interface{}) 1191 if act.Time != nil { 1192 objectMap["time"] = act.Time 1193 } 1194 if act.OdataType != "" { 1195 objectMap["@odata.type"] = act.OdataType 1196 } 1197 return json.Marshal(objectMap) 1198} 1199 1200// AsAbsoluteClipTime is the BasicClipTime implementation for AbsoluteClipTime. 1201func (act AbsoluteClipTime) AsAbsoluteClipTime() (*AbsoluteClipTime, bool) { 1202 return &act, true 1203} 1204 1205// AsClipTime is the BasicClipTime implementation for AbsoluteClipTime. 1206func (act AbsoluteClipTime) AsClipTime() (*ClipTime, bool) { 1207 return nil, false 1208} 1209 1210// AsBasicClipTime is the BasicClipTime implementation for AbsoluteClipTime. 1211func (act AbsoluteClipTime) AsBasicClipTime() (BasicClipTime, bool) { 1212 return &act, true 1213} 1214 1215// AccountFilter an Account Filter. 1216type AccountFilter struct { 1217 autorest.Response `json:"-"` 1218 *FilterProperties `json:"properties,omitempty"` 1219 // ID - READ-ONLY; Fully qualified resource ID for the resource. 1220 ID *string `json:"id,omitempty"` 1221 // Name - READ-ONLY; The name of the resource. 1222 Name *string `json:"name,omitempty"` 1223 // Type - READ-ONLY; The type of the resource. 1224 Type *string `json:"type,omitempty"` 1225} 1226 1227// MarshalJSON is the custom marshaler for AccountFilter. 1228func (af AccountFilter) MarshalJSON() ([]byte, error) { 1229 objectMap := make(map[string]interface{}) 1230 if af.FilterProperties != nil { 1231 objectMap["properties"] = af.FilterProperties 1232 } 1233 return json.Marshal(objectMap) 1234} 1235 1236// UnmarshalJSON is the custom unmarshaler for AccountFilter struct. 1237func (af *AccountFilter) UnmarshalJSON(body []byte) error { 1238 var m map[string]*json.RawMessage 1239 err := json.Unmarshal(body, &m) 1240 if err != nil { 1241 return err 1242 } 1243 for k, v := range m { 1244 switch k { 1245 case "properties": 1246 if v != nil { 1247 var filterProperties FilterProperties 1248 err = json.Unmarshal(*v, &filterProperties) 1249 if err != nil { 1250 return err 1251 } 1252 af.FilterProperties = &filterProperties 1253 } 1254 case "id": 1255 if v != nil { 1256 var ID string 1257 err = json.Unmarshal(*v, &ID) 1258 if err != nil { 1259 return err 1260 } 1261 af.ID = &ID 1262 } 1263 case "name": 1264 if v != nil { 1265 var name string 1266 err = json.Unmarshal(*v, &name) 1267 if err != nil { 1268 return err 1269 } 1270 af.Name = &name 1271 } 1272 case "type": 1273 if v != nil { 1274 var typeVar string 1275 err = json.Unmarshal(*v, &typeVar) 1276 if err != nil { 1277 return err 1278 } 1279 af.Type = &typeVar 1280 } 1281 } 1282 } 1283 1284 return nil 1285} 1286 1287// AccountFilterCollection a collection of AccountFilter items. 1288type AccountFilterCollection struct { 1289 autorest.Response `json:"-"` 1290 // Value - A collection of AccountFilter items. 1291 Value *[]AccountFilter `json:"value,omitempty"` 1292 // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). 1293 OdataNextLink *string `json:"@odata.nextLink,omitempty"` 1294} 1295 1296// AccountFilterCollectionIterator provides access to a complete listing of AccountFilter values. 1297type AccountFilterCollectionIterator struct { 1298 i int 1299 page AccountFilterCollectionPage 1300} 1301 1302// NextWithContext advances to the next value. If there was an error making 1303// the request the iterator does not advance and the error is returned. 1304func (iter *AccountFilterCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1305 if tracing.IsEnabled() { 1306 ctx = tracing.StartSpan(ctx, fqdn+"/AccountFilterCollectionIterator.NextWithContext") 1307 defer func() { 1308 sc := -1 1309 if iter.Response().Response.Response != nil { 1310 sc = iter.Response().Response.Response.StatusCode 1311 } 1312 tracing.EndSpan(ctx, sc, err) 1313 }() 1314 } 1315 iter.i++ 1316 if iter.i < len(iter.page.Values()) { 1317 return nil 1318 } 1319 err = iter.page.NextWithContext(ctx) 1320 if err != nil { 1321 iter.i-- 1322 return err 1323 } 1324 iter.i = 0 1325 return nil 1326} 1327 1328// Next advances to the next value. If there was an error making 1329// the request the iterator does not advance and the error is returned. 1330// Deprecated: Use NextWithContext() instead. 1331func (iter *AccountFilterCollectionIterator) Next() error { 1332 return iter.NextWithContext(context.Background()) 1333} 1334 1335// NotDone returns true if the enumeration should be started or is not yet complete. 1336func (iter AccountFilterCollectionIterator) NotDone() bool { 1337 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1338} 1339 1340// Response returns the raw server response from the last page request. 1341func (iter AccountFilterCollectionIterator) Response() AccountFilterCollection { 1342 return iter.page.Response() 1343} 1344 1345// Value returns the current value or a zero-initialized value if the 1346// iterator has advanced beyond the end of the collection. 1347func (iter AccountFilterCollectionIterator) Value() AccountFilter { 1348 if !iter.page.NotDone() { 1349 return AccountFilter{} 1350 } 1351 return iter.page.Values()[iter.i] 1352} 1353 1354// Creates a new instance of the AccountFilterCollectionIterator type. 1355func NewAccountFilterCollectionIterator(page AccountFilterCollectionPage) AccountFilterCollectionIterator { 1356 return AccountFilterCollectionIterator{page: page} 1357} 1358 1359// IsEmpty returns true if the ListResult contains no values. 1360func (afc AccountFilterCollection) IsEmpty() bool { 1361 return afc.Value == nil || len(*afc.Value) == 0 1362} 1363 1364// accountFilterCollectionPreparer prepares a request to retrieve the next set of results. 1365// It returns nil if no more results exist. 1366func (afc AccountFilterCollection) accountFilterCollectionPreparer(ctx context.Context) (*http.Request, error) { 1367 if afc.OdataNextLink == nil || len(to.String(afc.OdataNextLink)) < 1 { 1368 return nil, nil 1369 } 1370 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1371 autorest.AsJSON(), 1372 autorest.AsGet(), 1373 autorest.WithBaseURL(to.String(afc.OdataNextLink))) 1374} 1375 1376// AccountFilterCollectionPage contains a page of AccountFilter values. 1377type AccountFilterCollectionPage struct { 1378 fn func(context.Context, AccountFilterCollection) (AccountFilterCollection, error) 1379 afc AccountFilterCollection 1380} 1381 1382// NextWithContext advances to the next page of values. If there was an error making 1383// the request the page does not advance and the error is returned. 1384func (page *AccountFilterCollectionPage) NextWithContext(ctx context.Context) (err error) { 1385 if tracing.IsEnabled() { 1386 ctx = tracing.StartSpan(ctx, fqdn+"/AccountFilterCollectionPage.NextWithContext") 1387 defer func() { 1388 sc := -1 1389 if page.Response().Response.Response != nil { 1390 sc = page.Response().Response.Response.StatusCode 1391 } 1392 tracing.EndSpan(ctx, sc, err) 1393 }() 1394 } 1395 next, err := page.fn(ctx, page.afc) 1396 if err != nil { 1397 return err 1398 } 1399 page.afc = next 1400 return nil 1401} 1402 1403// Next advances to the next page of values. If there was an error making 1404// the request the page does not advance and the error is returned. 1405// Deprecated: Use NextWithContext() instead. 1406func (page *AccountFilterCollectionPage) Next() error { 1407 return page.NextWithContext(context.Background()) 1408} 1409 1410// NotDone returns true if the page enumeration should be started or is not yet complete. 1411func (page AccountFilterCollectionPage) NotDone() bool { 1412 return !page.afc.IsEmpty() 1413} 1414 1415// Response returns the raw server response from the last page request. 1416func (page AccountFilterCollectionPage) Response() AccountFilterCollection { 1417 return page.afc 1418} 1419 1420// Values returns the slice of values for the current page or nil if there are no values. 1421func (page AccountFilterCollectionPage) Values() []AccountFilter { 1422 if page.afc.IsEmpty() { 1423 return nil 1424 } 1425 return *page.afc.Value 1426} 1427 1428// Creates a new instance of the AccountFilterCollectionPage type. 1429func NewAccountFilterCollectionPage(getNextPage func(context.Context, AccountFilterCollection) (AccountFilterCollection, error)) AccountFilterCollectionPage { 1430 return AccountFilterCollectionPage{fn: getNextPage} 1431} 1432 1433// AkamaiAccessControl akamai access control 1434type AkamaiAccessControl struct { 1435 // AkamaiSignatureHeaderAuthenticationKeyList - authentication key list 1436 AkamaiSignatureHeaderAuthenticationKeyList *[]AkamaiSignatureHeaderAuthenticationKey `json:"akamaiSignatureHeaderAuthenticationKeyList,omitempty"` 1437} 1438 1439// AkamaiSignatureHeaderAuthenticationKey akamai Signature Header authentication key. 1440type AkamaiSignatureHeaderAuthenticationKey struct { 1441 // Identifier - identifier of the key 1442 Identifier *string `json:"identifier,omitempty"` 1443 // Base64Key - authentication key 1444 Base64Key *string `json:"base64Key,omitempty"` 1445 // Expiration - The expiration time of the authentication key. 1446 Expiration *date.Time `json:"expiration,omitempty"` 1447} 1448 1449// APIError the API error. 1450type APIError struct { 1451 // Error - The error properties. 1452 Error *ODataError `json:"error,omitempty"` 1453} 1454 1455// Asset an Asset. 1456type Asset struct { 1457 autorest.Response `json:"-"` 1458 // AssetProperties - The resource properties. 1459 *AssetProperties `json:"properties,omitempty"` 1460 // ID - READ-ONLY; Fully qualified resource ID for the resource. 1461 ID *string `json:"id,omitempty"` 1462 // Name - READ-ONLY; The name of the resource. 1463 Name *string `json:"name,omitempty"` 1464 // Type - READ-ONLY; The type of the resource. 1465 Type *string `json:"type,omitempty"` 1466} 1467 1468// MarshalJSON is the custom marshaler for Asset. 1469func (a Asset) MarshalJSON() ([]byte, error) { 1470 objectMap := make(map[string]interface{}) 1471 if a.AssetProperties != nil { 1472 objectMap["properties"] = a.AssetProperties 1473 } 1474 return json.Marshal(objectMap) 1475} 1476 1477// UnmarshalJSON is the custom unmarshaler for Asset struct. 1478func (a *Asset) UnmarshalJSON(body []byte) error { 1479 var m map[string]*json.RawMessage 1480 err := json.Unmarshal(body, &m) 1481 if err != nil { 1482 return err 1483 } 1484 for k, v := range m { 1485 switch k { 1486 case "properties": 1487 if v != nil { 1488 var assetProperties AssetProperties 1489 err = json.Unmarshal(*v, &assetProperties) 1490 if err != nil { 1491 return err 1492 } 1493 a.AssetProperties = &assetProperties 1494 } 1495 case "id": 1496 if v != nil { 1497 var ID string 1498 err = json.Unmarshal(*v, &ID) 1499 if err != nil { 1500 return err 1501 } 1502 a.ID = &ID 1503 } 1504 case "name": 1505 if v != nil { 1506 var name string 1507 err = json.Unmarshal(*v, &name) 1508 if err != nil { 1509 return err 1510 } 1511 a.Name = &name 1512 } 1513 case "type": 1514 if v != nil { 1515 var typeVar string 1516 err = json.Unmarshal(*v, &typeVar) 1517 if err != nil { 1518 return err 1519 } 1520 a.Type = &typeVar 1521 } 1522 } 1523 } 1524 1525 return nil 1526} 1527 1528// AssetCollection a collection of Asset items. 1529type AssetCollection struct { 1530 autorest.Response `json:"-"` 1531 // Value - A collection of Asset items. 1532 Value *[]Asset `json:"value,omitempty"` 1533 // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). 1534 OdataNextLink *string `json:"@odata.nextLink,omitempty"` 1535} 1536 1537// AssetCollectionIterator provides access to a complete listing of Asset values. 1538type AssetCollectionIterator struct { 1539 i int 1540 page AssetCollectionPage 1541} 1542 1543// NextWithContext advances to the next value. If there was an error making 1544// the request the iterator does not advance and the error is returned. 1545func (iter *AssetCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1546 if tracing.IsEnabled() { 1547 ctx = tracing.StartSpan(ctx, fqdn+"/AssetCollectionIterator.NextWithContext") 1548 defer func() { 1549 sc := -1 1550 if iter.Response().Response.Response != nil { 1551 sc = iter.Response().Response.Response.StatusCode 1552 } 1553 tracing.EndSpan(ctx, sc, err) 1554 }() 1555 } 1556 iter.i++ 1557 if iter.i < len(iter.page.Values()) { 1558 return nil 1559 } 1560 err = iter.page.NextWithContext(ctx) 1561 if err != nil { 1562 iter.i-- 1563 return err 1564 } 1565 iter.i = 0 1566 return nil 1567} 1568 1569// Next advances to the next value. If there was an error making 1570// the request the iterator does not advance and the error is returned. 1571// Deprecated: Use NextWithContext() instead. 1572func (iter *AssetCollectionIterator) Next() error { 1573 return iter.NextWithContext(context.Background()) 1574} 1575 1576// NotDone returns true if the enumeration should be started or is not yet complete. 1577func (iter AssetCollectionIterator) NotDone() bool { 1578 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1579} 1580 1581// Response returns the raw server response from the last page request. 1582func (iter AssetCollectionIterator) Response() AssetCollection { 1583 return iter.page.Response() 1584} 1585 1586// Value returns the current value or a zero-initialized value if the 1587// iterator has advanced beyond the end of the collection. 1588func (iter AssetCollectionIterator) Value() Asset { 1589 if !iter.page.NotDone() { 1590 return Asset{} 1591 } 1592 return iter.page.Values()[iter.i] 1593} 1594 1595// Creates a new instance of the AssetCollectionIterator type. 1596func NewAssetCollectionIterator(page AssetCollectionPage) AssetCollectionIterator { 1597 return AssetCollectionIterator{page: page} 1598} 1599 1600// IsEmpty returns true if the ListResult contains no values. 1601func (ac AssetCollection) IsEmpty() bool { 1602 return ac.Value == nil || len(*ac.Value) == 0 1603} 1604 1605// assetCollectionPreparer prepares a request to retrieve the next set of results. 1606// It returns nil if no more results exist. 1607func (ac AssetCollection) assetCollectionPreparer(ctx context.Context) (*http.Request, error) { 1608 if ac.OdataNextLink == nil || len(to.String(ac.OdataNextLink)) < 1 { 1609 return nil, nil 1610 } 1611 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1612 autorest.AsJSON(), 1613 autorest.AsGet(), 1614 autorest.WithBaseURL(to.String(ac.OdataNextLink))) 1615} 1616 1617// AssetCollectionPage contains a page of Asset values. 1618type AssetCollectionPage struct { 1619 fn func(context.Context, AssetCollection) (AssetCollection, error) 1620 ac AssetCollection 1621} 1622 1623// NextWithContext advances to the next page of values. If there was an error making 1624// the request the page does not advance and the error is returned. 1625func (page *AssetCollectionPage) NextWithContext(ctx context.Context) (err error) { 1626 if tracing.IsEnabled() { 1627 ctx = tracing.StartSpan(ctx, fqdn+"/AssetCollectionPage.NextWithContext") 1628 defer func() { 1629 sc := -1 1630 if page.Response().Response.Response != nil { 1631 sc = page.Response().Response.Response.StatusCode 1632 } 1633 tracing.EndSpan(ctx, sc, err) 1634 }() 1635 } 1636 next, err := page.fn(ctx, page.ac) 1637 if err != nil { 1638 return err 1639 } 1640 page.ac = next 1641 return nil 1642} 1643 1644// Next advances to the next page of values. If there was an error making 1645// the request the page does not advance and the error is returned. 1646// Deprecated: Use NextWithContext() instead. 1647func (page *AssetCollectionPage) Next() error { 1648 return page.NextWithContext(context.Background()) 1649} 1650 1651// NotDone returns true if the page enumeration should be started or is not yet complete. 1652func (page AssetCollectionPage) NotDone() bool { 1653 return !page.ac.IsEmpty() 1654} 1655 1656// Response returns the raw server response from the last page request. 1657func (page AssetCollectionPage) Response() AssetCollection { 1658 return page.ac 1659} 1660 1661// Values returns the slice of values for the current page or nil if there are no values. 1662func (page AssetCollectionPage) Values() []Asset { 1663 if page.ac.IsEmpty() { 1664 return nil 1665 } 1666 return *page.ac.Value 1667} 1668 1669// Creates a new instance of the AssetCollectionPage type. 1670func NewAssetCollectionPage(getNextPage func(context.Context, AssetCollection) (AssetCollection, error)) AssetCollectionPage { 1671 return AssetCollectionPage{fn: getNextPage} 1672} 1673 1674// AssetContainerSas the Asset Storage container SAS URLs. 1675type AssetContainerSas struct { 1676 autorest.Response `json:"-"` 1677 // AssetContainerSasUrls - The list of Asset container SAS URLs. 1678 AssetContainerSasUrls *[]string `json:"assetContainerSasUrls,omitempty"` 1679} 1680 1681// AssetFileEncryptionMetadata the Asset File Storage encryption metadata. 1682type AssetFileEncryptionMetadata struct { 1683 // InitializationVector - The Asset File initialization vector. 1684 InitializationVector *string `json:"initializationVector,omitempty"` 1685 // AssetFileName - The Asset File name. 1686 AssetFileName *string `json:"assetFileName,omitempty"` 1687 // AssetFileID - The Asset File Id. 1688 AssetFileID *uuid.UUID `json:"assetFileId,omitempty"` 1689} 1690 1691// AssetFilter an Asset Filter. 1692type AssetFilter struct { 1693 autorest.Response `json:"-"` 1694 *FilterProperties `json:"properties,omitempty"` 1695 // ID - READ-ONLY; Fully qualified resource ID for the resource. 1696 ID *string `json:"id,omitempty"` 1697 // Name - READ-ONLY; The name of the resource. 1698 Name *string `json:"name,omitempty"` 1699 // Type - READ-ONLY; The type of the resource. 1700 Type *string `json:"type,omitempty"` 1701} 1702 1703// MarshalJSON is the custom marshaler for AssetFilter. 1704func (af AssetFilter) MarshalJSON() ([]byte, error) { 1705 objectMap := make(map[string]interface{}) 1706 if af.FilterProperties != nil { 1707 objectMap["properties"] = af.FilterProperties 1708 } 1709 return json.Marshal(objectMap) 1710} 1711 1712// UnmarshalJSON is the custom unmarshaler for AssetFilter struct. 1713func (af *AssetFilter) UnmarshalJSON(body []byte) error { 1714 var m map[string]*json.RawMessage 1715 err := json.Unmarshal(body, &m) 1716 if err != nil { 1717 return err 1718 } 1719 for k, v := range m { 1720 switch k { 1721 case "properties": 1722 if v != nil { 1723 var filterProperties FilterProperties 1724 err = json.Unmarshal(*v, &filterProperties) 1725 if err != nil { 1726 return err 1727 } 1728 af.FilterProperties = &filterProperties 1729 } 1730 case "id": 1731 if v != nil { 1732 var ID string 1733 err = json.Unmarshal(*v, &ID) 1734 if err != nil { 1735 return err 1736 } 1737 af.ID = &ID 1738 } 1739 case "name": 1740 if v != nil { 1741 var name string 1742 err = json.Unmarshal(*v, &name) 1743 if err != nil { 1744 return err 1745 } 1746 af.Name = &name 1747 } 1748 case "type": 1749 if v != nil { 1750 var typeVar string 1751 err = json.Unmarshal(*v, &typeVar) 1752 if err != nil { 1753 return err 1754 } 1755 af.Type = &typeVar 1756 } 1757 } 1758 } 1759 1760 return nil 1761} 1762 1763// AssetFilterCollection a collection of AssetFilter items. 1764type AssetFilterCollection struct { 1765 autorest.Response `json:"-"` 1766 // Value - A collection of AssetFilter items. 1767 Value *[]AssetFilter `json:"value,omitempty"` 1768 // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). 1769 OdataNextLink *string `json:"@odata.nextLink,omitempty"` 1770} 1771 1772// AssetFilterCollectionIterator provides access to a complete listing of AssetFilter values. 1773type AssetFilterCollectionIterator struct { 1774 i int 1775 page AssetFilterCollectionPage 1776} 1777 1778// NextWithContext advances to the next value. If there was an error making 1779// the request the iterator does not advance and the error is returned. 1780func (iter *AssetFilterCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1781 if tracing.IsEnabled() { 1782 ctx = tracing.StartSpan(ctx, fqdn+"/AssetFilterCollectionIterator.NextWithContext") 1783 defer func() { 1784 sc := -1 1785 if iter.Response().Response.Response != nil { 1786 sc = iter.Response().Response.Response.StatusCode 1787 } 1788 tracing.EndSpan(ctx, sc, err) 1789 }() 1790 } 1791 iter.i++ 1792 if iter.i < len(iter.page.Values()) { 1793 return nil 1794 } 1795 err = iter.page.NextWithContext(ctx) 1796 if err != nil { 1797 iter.i-- 1798 return err 1799 } 1800 iter.i = 0 1801 return nil 1802} 1803 1804// Next advances to the next value. If there was an error making 1805// the request the iterator does not advance and the error is returned. 1806// Deprecated: Use NextWithContext() instead. 1807func (iter *AssetFilterCollectionIterator) Next() error { 1808 return iter.NextWithContext(context.Background()) 1809} 1810 1811// NotDone returns true if the enumeration should be started or is not yet complete. 1812func (iter AssetFilterCollectionIterator) NotDone() bool { 1813 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1814} 1815 1816// Response returns the raw server response from the last page request. 1817func (iter AssetFilterCollectionIterator) Response() AssetFilterCollection { 1818 return iter.page.Response() 1819} 1820 1821// Value returns the current value or a zero-initialized value if the 1822// iterator has advanced beyond the end of the collection. 1823func (iter AssetFilterCollectionIterator) Value() AssetFilter { 1824 if !iter.page.NotDone() { 1825 return AssetFilter{} 1826 } 1827 return iter.page.Values()[iter.i] 1828} 1829 1830// Creates a new instance of the AssetFilterCollectionIterator type. 1831func NewAssetFilterCollectionIterator(page AssetFilterCollectionPage) AssetFilterCollectionIterator { 1832 return AssetFilterCollectionIterator{page: page} 1833} 1834 1835// IsEmpty returns true if the ListResult contains no values. 1836func (afc AssetFilterCollection) IsEmpty() bool { 1837 return afc.Value == nil || len(*afc.Value) == 0 1838} 1839 1840// assetFilterCollectionPreparer prepares a request to retrieve the next set of results. 1841// It returns nil if no more results exist. 1842func (afc AssetFilterCollection) assetFilterCollectionPreparer(ctx context.Context) (*http.Request, error) { 1843 if afc.OdataNextLink == nil || len(to.String(afc.OdataNextLink)) < 1 { 1844 return nil, nil 1845 } 1846 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1847 autorest.AsJSON(), 1848 autorest.AsGet(), 1849 autorest.WithBaseURL(to.String(afc.OdataNextLink))) 1850} 1851 1852// AssetFilterCollectionPage contains a page of AssetFilter values. 1853type AssetFilterCollectionPage struct { 1854 fn func(context.Context, AssetFilterCollection) (AssetFilterCollection, error) 1855 afc AssetFilterCollection 1856} 1857 1858// NextWithContext advances to the next page of values. If there was an error making 1859// the request the page does not advance and the error is returned. 1860func (page *AssetFilterCollectionPage) NextWithContext(ctx context.Context) (err error) { 1861 if tracing.IsEnabled() { 1862 ctx = tracing.StartSpan(ctx, fqdn+"/AssetFilterCollectionPage.NextWithContext") 1863 defer func() { 1864 sc := -1 1865 if page.Response().Response.Response != nil { 1866 sc = page.Response().Response.Response.StatusCode 1867 } 1868 tracing.EndSpan(ctx, sc, err) 1869 }() 1870 } 1871 next, err := page.fn(ctx, page.afc) 1872 if err != nil { 1873 return err 1874 } 1875 page.afc = next 1876 return nil 1877} 1878 1879// Next advances to the next page of values. If there was an error making 1880// the request the page does not advance and the error is returned. 1881// Deprecated: Use NextWithContext() instead. 1882func (page *AssetFilterCollectionPage) Next() error { 1883 return page.NextWithContext(context.Background()) 1884} 1885 1886// NotDone returns true if the page enumeration should be started or is not yet complete. 1887func (page AssetFilterCollectionPage) NotDone() bool { 1888 return !page.afc.IsEmpty() 1889} 1890 1891// Response returns the raw server response from the last page request. 1892func (page AssetFilterCollectionPage) Response() AssetFilterCollection { 1893 return page.afc 1894} 1895 1896// Values returns the slice of values for the current page or nil if there are no values. 1897func (page AssetFilterCollectionPage) Values() []AssetFilter { 1898 if page.afc.IsEmpty() { 1899 return nil 1900 } 1901 return *page.afc.Value 1902} 1903 1904// Creates a new instance of the AssetFilterCollectionPage type. 1905func NewAssetFilterCollectionPage(getNextPage func(context.Context, AssetFilterCollection) (AssetFilterCollection, error)) AssetFilterCollectionPage { 1906 return AssetFilterCollectionPage{fn: getNextPage} 1907} 1908 1909// AssetProperties the Asset properties. 1910type AssetProperties struct { 1911 // AssetID - READ-ONLY; The Asset ID. 1912 AssetID *uuid.UUID `json:"assetId,omitempty"` 1913 // Created - READ-ONLY; The creation date of the Asset. 1914 Created *date.Time `json:"created,omitempty"` 1915 // LastModified - READ-ONLY; The last modified date of the Asset. 1916 LastModified *date.Time `json:"lastModified,omitempty"` 1917 // AlternateID - The alternate ID of the Asset. 1918 AlternateID *string `json:"alternateId,omitempty"` 1919 // Description - The Asset description. 1920 Description *string `json:"description,omitempty"` 1921 // Container - The name of the asset blob container. 1922 Container *string `json:"container,omitempty"` 1923 // StorageAccountName - The name of the storage account. 1924 StorageAccountName *string `json:"storageAccountName,omitempty"` 1925 // StorageEncryptionFormat - READ-ONLY; The Asset encryption format. One of None or MediaStorageEncryption. Possible values include: 'None', 'MediaStorageClientEncryption' 1926 StorageEncryptionFormat AssetStorageEncryptionFormat `json:"storageEncryptionFormat,omitempty"` 1927} 1928 1929// AssetStreamingLocator properties of the Streaming Locator. 1930type AssetStreamingLocator struct { 1931 // Name - READ-ONLY; Streaming Locator name. 1932 Name *string `json:"name,omitempty"` 1933 // AssetName - READ-ONLY; Asset Name. 1934 AssetName *string `json:"assetName,omitempty"` 1935 // Created - READ-ONLY; The creation time of the Streaming Locator. 1936 Created *date.Time `json:"created,omitempty"` 1937 // StartTime - READ-ONLY; The start time of the Streaming Locator. 1938 StartTime *date.Time `json:"startTime,omitempty"` 1939 // EndTime - READ-ONLY; The end time of the Streaming Locator. 1940 EndTime *date.Time `json:"endTime,omitempty"` 1941 // StreamingLocatorID - READ-ONLY; StreamingLocatorId of the Streaming Locator. 1942 StreamingLocatorID *uuid.UUID `json:"streamingLocatorId,omitempty"` 1943 // StreamingPolicyName - READ-ONLY; Name of the Streaming Policy used by this Streaming Locator. 1944 StreamingPolicyName *string `json:"streamingPolicyName,omitempty"` 1945 // DefaultContentKeyPolicyName - READ-ONLY; Name of the default ContentKeyPolicy used by this Streaming Locator. 1946 DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"` 1947} 1948 1949// BasicAudio defines the common properties for all audio codecs. 1950type BasicAudio interface { 1951 AsAacAudio() (*AacAudio, bool) 1952 AsAudio() (*Audio, bool) 1953} 1954 1955// Audio defines the common properties for all audio codecs. 1956type Audio struct { 1957 // Channels - The number of channels in the audio. 1958 Channels *int32 `json:"channels,omitempty"` 1959 // SamplingRate - The sampling rate to use for encoding in hertz. 1960 SamplingRate *int32 `json:"samplingRate,omitempty"` 1961 // Bitrate - The bitrate, in bits per second, of the output encoded audio. 1962 Bitrate *int32 `json:"bitrate,omitempty"` 1963 // Label - An optional label for the codec. The label can be used to control muxing behavior. 1964 Label *string `json:"label,omitempty"` 1965 // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' 1966 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` 1967} 1968 1969func unmarshalBasicAudio(body []byte) (BasicAudio, error) { 1970 var m map[string]interface{} 1971 err := json.Unmarshal(body, &m) 1972 if err != nil { 1973 return nil, err 1974 } 1975 1976 switch m["@odata.type"] { 1977 case string(OdataTypeMicrosoftMediaAacAudio): 1978 var aa AacAudio 1979 err := json.Unmarshal(body, &aa) 1980 return aa, err 1981 default: 1982 var a Audio 1983 err := json.Unmarshal(body, &a) 1984 return a, err 1985 } 1986} 1987func unmarshalBasicAudioArray(body []byte) ([]BasicAudio, error) { 1988 var rawMessages []*json.RawMessage 1989 err := json.Unmarshal(body, &rawMessages) 1990 if err != nil { 1991 return nil, err 1992 } 1993 1994 aArray := make([]BasicAudio, len(rawMessages)) 1995 1996 for index, rawMessage := range rawMessages { 1997 a, err := unmarshalBasicAudio(*rawMessage) 1998 if err != nil { 1999 return nil, err 2000 } 2001 aArray[index] = a 2002 } 2003 return aArray, nil 2004} 2005 2006// MarshalJSON is the custom marshaler for Audio. 2007func (a Audio) MarshalJSON() ([]byte, error) { 2008 a.OdataType = OdataTypeMicrosoftMediaAudio 2009 objectMap := make(map[string]interface{}) 2010 if a.Channels != nil { 2011 objectMap["channels"] = a.Channels 2012 } 2013 if a.SamplingRate != nil { 2014 objectMap["samplingRate"] = a.SamplingRate 2015 } 2016 if a.Bitrate != nil { 2017 objectMap["bitrate"] = a.Bitrate 2018 } 2019 if a.Label != nil { 2020 objectMap["label"] = a.Label 2021 } 2022 if a.OdataType != "" { 2023 objectMap["@odata.type"] = a.OdataType 2024 } 2025 return json.Marshal(objectMap) 2026} 2027 2028// AsAudio is the BasicCodec implementation for Audio. 2029func (a Audio) AsAudio() (*Audio, bool) { 2030 return &a, true 2031} 2032 2033// AsBasicAudio is the BasicCodec implementation for Audio. 2034func (a Audio) AsBasicAudio() (BasicAudio, bool) { 2035 return &a, true 2036} 2037 2038// AsAacAudio is the BasicCodec implementation for Audio. 2039func (a Audio) AsAacAudio() (*AacAudio, bool) { 2040 return nil, false 2041} 2042 2043// AsCopyVideo is the BasicCodec implementation for Audio. 2044func (a Audio) AsCopyVideo() (*CopyVideo, bool) { 2045 return nil, false 2046} 2047 2048// AsVideo is the BasicCodec implementation for Audio. 2049func (a Audio) AsVideo() (*Video, bool) { 2050 return nil, false 2051} 2052 2053// AsBasicVideo is the BasicCodec implementation for Audio. 2054func (a Audio) AsBasicVideo() (BasicVideo, bool) { 2055 return nil, false 2056} 2057 2058// AsImage is the BasicCodec implementation for Audio. 2059func (a Audio) AsImage() (*Image, bool) { 2060 return nil, false 2061} 2062 2063// AsBasicImage is the BasicCodec implementation for Audio. 2064func (a Audio) AsBasicImage() (BasicImage, bool) { 2065 return nil, false 2066} 2067 2068// AsCopyAudio is the BasicCodec implementation for Audio. 2069func (a Audio) AsCopyAudio() (*CopyAudio, bool) { 2070 return nil, false 2071} 2072 2073// AsH264Video is the BasicCodec implementation for Audio. 2074func (a Audio) AsH264Video() (*H264Video, bool) { 2075 return nil, false 2076} 2077 2078// AsJpgImage is the BasicCodec implementation for Audio. 2079func (a Audio) AsJpgImage() (*JpgImage, bool) { 2080 return nil, false 2081} 2082 2083// AsPngImage is the BasicCodec implementation for Audio. 2084func (a Audio) AsPngImage() (*PngImage, bool) { 2085 return nil, false 2086} 2087 2088// AsCodec is the BasicCodec implementation for Audio. 2089func (a Audio) AsCodec() (*Codec, bool) { 2090 return nil, false 2091} 2092 2093// AsBasicCodec is the BasicCodec implementation for Audio. 2094func (a Audio) AsBasicCodec() (BasicCodec, bool) { 2095 return &a, true 2096} 2097 2098// BasicAudioAnalyzerPreset the Audio Analyzer preset applies a pre-defined set of AI-based analysis operations, 2099// including speech transcription. Currently, the preset supports processing of content with a single audio track. 2100type BasicAudioAnalyzerPreset interface { 2101 AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) 2102 AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) 2103} 2104 2105// AudioAnalyzerPreset the Audio Analyzer preset applies a pre-defined set of AI-based analysis operations, 2106// including speech transcription. Currently, the preset supports processing of content with a single audio 2107// track. 2108type AudioAnalyzerPreset struct { 2109 // AudioLanguage - The language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). The list of supported languages are English ('en-US' and 'en-GB'), Spanish ('es-ES' and 'es-MX'), French ('fr-FR'), Italian ('it-IT'), Japanese ('ja-JP'), Portuguese ('pt-BR'), Chinese ('zh-CN'), German ('de-DE'), Arabic ('ar-EG' and 'ar-SY'), Russian ('ru-RU'), Hindi ('hi-IN'), and Korean ('ko-KR'). If you know the language of your content, it is recommended that you specify it. If the language isn't specified or set to null, automatic language detection will choose the first language detected and process with the selected language for the duration of the file. This language detection feature currently supports English, Chinese, French, German, Italian, Japanese, Spanish, Russian, and Portuguese. It does not currently support dynamically switching between languages after the first language is detected. The automatic detection works best with audio recordings with clearly discernable speech. If automatic detection fails to find the language, transcription would fallback to 'en-US'." 2110 AudioLanguage *string `json:"audioLanguage,omitempty"` 2111 // OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset' 2112 OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"` 2113} 2114 2115func unmarshalBasicAudioAnalyzerPreset(body []byte) (BasicAudioAnalyzerPreset, error) { 2116 var m map[string]interface{} 2117 err := json.Unmarshal(body, &m) 2118 if err != nil { 2119 return nil, err 2120 } 2121 2122 switch m["@odata.type"] { 2123 case string(OdataTypeMicrosoftMediaVideoAnalyzerPreset): 2124 var vap VideoAnalyzerPreset 2125 err := json.Unmarshal(body, &vap) 2126 return vap, err 2127 default: 2128 var aap AudioAnalyzerPreset 2129 err := json.Unmarshal(body, &aap) 2130 return aap, err 2131 } 2132} 2133func unmarshalBasicAudioAnalyzerPresetArray(body []byte) ([]BasicAudioAnalyzerPreset, error) { 2134 var rawMessages []*json.RawMessage 2135 err := json.Unmarshal(body, &rawMessages) 2136 if err != nil { 2137 return nil, err 2138 } 2139 2140 aapArray := make([]BasicAudioAnalyzerPreset, len(rawMessages)) 2141 2142 for index, rawMessage := range rawMessages { 2143 aap, err := unmarshalBasicAudioAnalyzerPreset(*rawMessage) 2144 if err != nil { 2145 return nil, err 2146 } 2147 aapArray[index] = aap 2148 } 2149 return aapArray, nil 2150} 2151 2152// MarshalJSON is the custom marshaler for AudioAnalyzerPreset. 2153func (aap AudioAnalyzerPreset) MarshalJSON() ([]byte, error) { 2154 aap.OdataType = OdataTypeMicrosoftMediaAudioAnalyzerPreset 2155 objectMap := make(map[string]interface{}) 2156 if aap.AudioLanguage != nil { 2157 objectMap["audioLanguage"] = aap.AudioLanguage 2158 } 2159 if aap.OdataType != "" { 2160 objectMap["@odata.type"] = aap.OdataType 2161 } 2162 return json.Marshal(objectMap) 2163} 2164 2165// AsFaceDetectorPreset is the BasicPreset implementation for AudioAnalyzerPreset. 2166func (aap AudioAnalyzerPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) { 2167 return nil, false 2168} 2169 2170// AsAudioAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset. 2171func (aap AudioAnalyzerPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) { 2172 return &aap, true 2173} 2174 2175// AsBasicAudioAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset. 2176func (aap AudioAnalyzerPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) { 2177 return &aap, true 2178} 2179 2180// AsBuiltInStandardEncoderPreset is the BasicPreset implementation for AudioAnalyzerPreset. 2181func (aap AudioAnalyzerPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) { 2182 return nil, false 2183} 2184 2185// AsStandardEncoderPreset is the BasicPreset implementation for AudioAnalyzerPreset. 2186func (aap AudioAnalyzerPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) { 2187 return nil, false 2188} 2189 2190// AsVideoAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset. 2191func (aap AudioAnalyzerPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) { 2192 return nil, false 2193} 2194 2195// AsPreset is the BasicPreset implementation for AudioAnalyzerPreset. 2196func (aap AudioAnalyzerPreset) AsPreset() (*Preset, bool) { 2197 return nil, false 2198} 2199 2200// AsBasicPreset is the BasicPreset implementation for AudioAnalyzerPreset. 2201func (aap AudioAnalyzerPreset) AsBasicPreset() (BasicPreset, bool) { 2202 return &aap, true 2203} 2204 2205// AudioOverlay describes the properties of an audio overlay. 2206type AudioOverlay struct { 2207 // InputLabel - The label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG or PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats. 2208 InputLabel *string `json:"inputLabel,omitempty"` 2209 // Start - The start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds in to the input video. If not specified the overlay starts from the beginning of the input video. 2210 Start *string `json:"start,omitempty"` 2211 // End - The position in the input video at which the overlay ends. The value should be in ISO 8601 duration format. For example, PT30S to end the overlay at 30 seconds in to the input video. If not specified the overlay will be applied until the end of the input video if inputLoop is true. Else, if inputLoop is false, then overlay will last as long as the duration of the overlay media. 2212 End *string `json:"end,omitempty"` 2213 // FadeInDuration - The duration over which the overlay fades in onto the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade in (same as PT0S). 2214 FadeInDuration *string `json:"fadeInDuration,omitempty"` 2215 // FadeOutDuration - The duration over which the overlay fades out of the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade out (same as PT0S). 2216 FadeOutDuration *string `json:"fadeOutDuration,omitempty"` 2217 // AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0. 2218 AudioGainLevel *float64 `json:"audioGainLevel,omitempty"` 2219 // OdataType - Possible values include: 'OdataTypeOverlay', 'OdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeMicrosoftMediaVideoOverlay' 2220 OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"` 2221} 2222 2223// MarshalJSON is the custom marshaler for AudioOverlay. 2224func (ao AudioOverlay) MarshalJSON() ([]byte, error) { 2225 ao.OdataType = OdataTypeMicrosoftMediaAudioOverlay 2226 objectMap := make(map[string]interface{}) 2227 if ao.InputLabel != nil { 2228 objectMap["inputLabel"] = ao.InputLabel 2229 } 2230 if ao.Start != nil { 2231 objectMap["start"] = ao.Start 2232 } 2233 if ao.End != nil { 2234 objectMap["end"] = ao.End 2235 } 2236 if ao.FadeInDuration != nil { 2237 objectMap["fadeInDuration"] = ao.FadeInDuration 2238 } 2239 if ao.FadeOutDuration != nil { 2240 objectMap["fadeOutDuration"] = ao.FadeOutDuration 2241 } 2242 if ao.AudioGainLevel != nil { 2243 objectMap["audioGainLevel"] = ao.AudioGainLevel 2244 } 2245 if ao.OdataType != "" { 2246 objectMap["@odata.type"] = ao.OdataType 2247 } 2248 return json.Marshal(objectMap) 2249} 2250 2251// AsAudioOverlay is the BasicOverlay implementation for AudioOverlay. 2252func (ao AudioOverlay) AsAudioOverlay() (*AudioOverlay, bool) { 2253 return &ao, true 2254} 2255 2256// AsVideoOverlay is the BasicOverlay implementation for AudioOverlay. 2257func (ao AudioOverlay) AsVideoOverlay() (*VideoOverlay, bool) { 2258 return nil, false 2259} 2260 2261// AsOverlay is the BasicOverlay implementation for AudioOverlay. 2262func (ao AudioOverlay) AsOverlay() (*Overlay, bool) { 2263 return nil, false 2264} 2265 2266// AsBasicOverlay is the BasicOverlay implementation for AudioOverlay. 2267func (ao AudioOverlay) AsBasicOverlay() (BasicOverlay, bool) { 2268 return &ao, true 2269} 2270 2271// BuiltInStandardEncoderPreset describes a built-in preset for encoding the input video with the Standard 2272// Encoder. 2273type BuiltInStandardEncoderPreset struct { 2274 // PresetName - The built-in preset to be used for encoding videos. Possible values include: 'H264SingleBitrateSD', 'H264SingleBitrate720p', 'H264SingleBitrate1080p', 'AdaptiveStreaming', 'AACGoodQualityAudio', 'ContentAwareEncodingExperimental', 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', 'H264MultipleBitrateSD' 2275 PresetName EncoderNamedPreset `json:"presetName,omitempty"` 2276 // OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset' 2277 OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"` 2278} 2279 2280// MarshalJSON is the custom marshaler for BuiltInStandardEncoderPreset. 2281func (bisep BuiltInStandardEncoderPreset) MarshalJSON() ([]byte, error) { 2282 bisep.OdataType = OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset 2283 objectMap := make(map[string]interface{}) 2284 if bisep.PresetName != "" { 2285 objectMap["presetName"] = bisep.PresetName 2286 } 2287 if bisep.OdataType != "" { 2288 objectMap["@odata.type"] = bisep.OdataType 2289 } 2290 return json.Marshal(objectMap) 2291} 2292 2293// AsFaceDetectorPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset. 2294func (bisep BuiltInStandardEncoderPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) { 2295 return nil, false 2296} 2297 2298// AsAudioAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset. 2299func (bisep BuiltInStandardEncoderPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) { 2300 return nil, false 2301} 2302 2303// AsBasicAudioAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset. 2304func (bisep BuiltInStandardEncoderPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) { 2305 return nil, false 2306} 2307 2308// AsBuiltInStandardEncoderPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset. 2309func (bisep BuiltInStandardEncoderPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) { 2310 return &bisep, true 2311} 2312 2313// AsStandardEncoderPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset. 2314func (bisep BuiltInStandardEncoderPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) { 2315 return nil, false 2316} 2317 2318// AsVideoAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset. 2319func (bisep BuiltInStandardEncoderPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) { 2320 return nil, false 2321} 2322 2323// AsPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset. 2324func (bisep BuiltInStandardEncoderPreset) AsPreset() (*Preset, bool) { 2325 return nil, false 2326} 2327 2328// AsBasicPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset. 2329func (bisep BuiltInStandardEncoderPreset) AsBasicPreset() (BasicPreset, bool) { 2330 return &bisep, true 2331} 2332 2333// CbcsDrmConfiguration class to specify DRM configurations of CommonEncryptionCbcs scheme in Streaming 2334// Policy 2335type CbcsDrmConfiguration struct { 2336 // FairPlay - FairPlay configurations 2337 FairPlay *StreamingPolicyFairPlayConfiguration `json:"fairPlay,omitempty"` 2338 // PlayReady - PlayReady configurations 2339 PlayReady *StreamingPolicyPlayReadyConfiguration `json:"playReady,omitempty"` 2340 // Widevine - Widevine configurations 2341 Widevine *StreamingPolicyWidevineConfiguration `json:"widevine,omitempty"` 2342} 2343 2344// CencDrmConfiguration class to specify DRM configurations of CommonEncryptionCenc scheme in Streaming 2345// Policy 2346type CencDrmConfiguration struct { 2347 // PlayReady - PlayReady configurations 2348 PlayReady *StreamingPolicyPlayReadyConfiguration `json:"playReady,omitempty"` 2349 // Widevine - Widevine configurations 2350 Widevine *StreamingPolicyWidevineConfiguration `json:"widevine,omitempty"` 2351} 2352 2353// CheckNameAvailabilityInput the input to the check name availability request. 2354type CheckNameAvailabilityInput struct { 2355 // Name - The account name. 2356 Name *string `json:"name,omitempty"` 2357 // Type - The account type. For a Media Services account, this should be 'MediaServices'. 2358 Type *string `json:"type,omitempty"` 2359} 2360 2361// BasicClipTime base class for specifying a clip time. Use sub classes of this class to specify the time position in 2362// the media. 2363type BasicClipTime interface { 2364 AsAbsoluteClipTime() (*AbsoluteClipTime, bool) 2365 AsClipTime() (*ClipTime, bool) 2366} 2367 2368// ClipTime base class for specifying a clip time. Use sub classes of this class to specify the time position 2369// in the media. 2370type ClipTime struct { 2371 // OdataType - Possible values include: 'OdataTypeClipTime', 'OdataTypeMicrosoftMediaAbsoluteClipTime' 2372 OdataType OdataTypeBasicClipTime `json:"@odata.type,omitempty"` 2373} 2374 2375func unmarshalBasicClipTime(body []byte) (BasicClipTime, error) { 2376 var m map[string]interface{} 2377 err := json.Unmarshal(body, &m) 2378 if err != nil { 2379 return nil, err 2380 } 2381 2382 switch m["@odata.type"] { 2383 case string(OdataTypeMicrosoftMediaAbsoluteClipTime): 2384 var act AbsoluteClipTime 2385 err := json.Unmarshal(body, &act) 2386 return act, err 2387 default: 2388 var ct ClipTime 2389 err := json.Unmarshal(body, &ct) 2390 return ct, err 2391 } 2392} 2393func unmarshalBasicClipTimeArray(body []byte) ([]BasicClipTime, error) { 2394 var rawMessages []*json.RawMessage 2395 err := json.Unmarshal(body, &rawMessages) 2396 if err != nil { 2397 return nil, err 2398 } 2399 2400 ctArray := make([]BasicClipTime, len(rawMessages)) 2401 2402 for index, rawMessage := range rawMessages { 2403 ct, err := unmarshalBasicClipTime(*rawMessage) 2404 if err != nil { 2405 return nil, err 2406 } 2407 ctArray[index] = ct 2408 } 2409 return ctArray, nil 2410} 2411 2412// MarshalJSON is the custom marshaler for ClipTime. 2413func (ct ClipTime) MarshalJSON() ([]byte, error) { 2414 ct.OdataType = OdataTypeClipTime 2415 objectMap := make(map[string]interface{}) 2416 if ct.OdataType != "" { 2417 objectMap["@odata.type"] = ct.OdataType 2418 } 2419 return json.Marshal(objectMap) 2420} 2421 2422// AsAbsoluteClipTime is the BasicClipTime implementation for ClipTime. 2423func (ct ClipTime) AsAbsoluteClipTime() (*AbsoluteClipTime, bool) { 2424 return nil, false 2425} 2426 2427// AsClipTime is the BasicClipTime implementation for ClipTime. 2428func (ct ClipTime) AsClipTime() (*ClipTime, bool) { 2429 return &ct, true 2430} 2431 2432// AsBasicClipTime is the BasicClipTime implementation for ClipTime. 2433func (ct ClipTime) AsBasicClipTime() (BasicClipTime, bool) { 2434 return &ct, true 2435} 2436 2437// BasicCodec describes the basic properties of all codecs. 2438type BasicCodec interface { 2439 AsAudio() (*Audio, bool) 2440 AsBasicAudio() (BasicAudio, bool) 2441 AsAacAudio() (*AacAudio, bool) 2442 AsCopyVideo() (*CopyVideo, bool) 2443 AsVideo() (*Video, bool) 2444 AsBasicVideo() (BasicVideo, bool) 2445 AsImage() (*Image, bool) 2446 AsBasicImage() (BasicImage, bool) 2447 AsCopyAudio() (*CopyAudio, bool) 2448 AsH264Video() (*H264Video, bool) 2449 AsJpgImage() (*JpgImage, bool) 2450 AsPngImage() (*PngImage, bool) 2451 AsCodec() (*Codec, bool) 2452} 2453 2454// Codec describes the basic properties of all codecs. 2455type Codec struct { 2456 // Label - An optional label for the codec. The label can be used to control muxing behavior. 2457 Label *string `json:"label,omitempty"` 2458 // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' 2459 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` 2460} 2461 2462func unmarshalBasicCodec(body []byte) (BasicCodec, error) { 2463 var m map[string]interface{} 2464 err := json.Unmarshal(body, &m) 2465 if err != nil { 2466 return nil, err 2467 } 2468 2469 switch m["@odata.type"] { 2470 case string(OdataTypeMicrosoftMediaAudio): 2471 var a Audio 2472 err := json.Unmarshal(body, &a) 2473 return a, err 2474 case string(OdataTypeMicrosoftMediaAacAudio): 2475 var aa AacAudio 2476 err := json.Unmarshal(body, &aa) 2477 return aa, err 2478 case string(OdataTypeMicrosoftMediaCopyVideo): 2479 var cv CopyVideo 2480 err := json.Unmarshal(body, &cv) 2481 return cv, err 2482 case string(OdataTypeMicrosoftMediaVideo): 2483 var vVar Video 2484 err := json.Unmarshal(body, &vVar) 2485 return vVar, err 2486 case string(OdataTypeMicrosoftMediaImage): 2487 var i Image 2488 err := json.Unmarshal(body, &i) 2489 return i, err 2490 case string(OdataTypeMicrosoftMediaCopyAudio): 2491 var ca CopyAudio 2492 err := json.Unmarshal(body, &ca) 2493 return ca, err 2494 case string(OdataTypeMicrosoftMediaH264Video): 2495 var hv H264Video 2496 err := json.Unmarshal(body, &hv) 2497 return hv, err 2498 case string(OdataTypeMicrosoftMediaJpgImage): 2499 var ji JpgImage 2500 err := json.Unmarshal(body, &ji) 2501 return ji, err 2502 case string(OdataTypeMicrosoftMediaPngImage): 2503 var pi PngImage 2504 err := json.Unmarshal(body, &pi) 2505 return pi, err 2506 default: 2507 var c Codec 2508 err := json.Unmarshal(body, &c) 2509 return c, err 2510 } 2511} 2512func unmarshalBasicCodecArray(body []byte) ([]BasicCodec, error) { 2513 var rawMessages []*json.RawMessage 2514 err := json.Unmarshal(body, &rawMessages) 2515 if err != nil { 2516 return nil, err 2517 } 2518 2519 cArray := make([]BasicCodec, len(rawMessages)) 2520 2521 for index, rawMessage := range rawMessages { 2522 c, err := unmarshalBasicCodec(*rawMessage) 2523 if err != nil { 2524 return nil, err 2525 } 2526 cArray[index] = c 2527 } 2528 return cArray, nil 2529} 2530 2531// MarshalJSON is the custom marshaler for Codec. 2532func (c Codec) MarshalJSON() ([]byte, error) { 2533 c.OdataType = OdataTypeCodec 2534 objectMap := make(map[string]interface{}) 2535 if c.Label != nil { 2536 objectMap["label"] = c.Label 2537 } 2538 if c.OdataType != "" { 2539 objectMap["@odata.type"] = c.OdataType 2540 } 2541 return json.Marshal(objectMap) 2542} 2543 2544// AsAudio is the BasicCodec implementation for Codec. 2545func (c Codec) AsAudio() (*Audio, bool) { 2546 return nil, false 2547} 2548 2549// AsBasicAudio is the BasicCodec implementation for Codec. 2550func (c Codec) AsBasicAudio() (BasicAudio, bool) { 2551 return nil, false 2552} 2553 2554// AsAacAudio is the BasicCodec implementation for Codec. 2555func (c Codec) AsAacAudio() (*AacAudio, bool) { 2556 return nil, false 2557} 2558 2559// AsCopyVideo is the BasicCodec implementation for Codec. 2560func (c Codec) AsCopyVideo() (*CopyVideo, bool) { 2561 return nil, false 2562} 2563 2564// AsVideo is the BasicCodec implementation for Codec. 2565func (c Codec) AsVideo() (*Video, bool) { 2566 return nil, false 2567} 2568 2569// AsBasicVideo is the BasicCodec implementation for Codec. 2570func (c Codec) AsBasicVideo() (BasicVideo, bool) { 2571 return nil, false 2572} 2573 2574// AsImage is the BasicCodec implementation for Codec. 2575func (c Codec) AsImage() (*Image, bool) { 2576 return nil, false 2577} 2578 2579// AsBasicImage is the BasicCodec implementation for Codec. 2580func (c Codec) AsBasicImage() (BasicImage, bool) { 2581 return nil, false 2582} 2583 2584// AsCopyAudio is the BasicCodec implementation for Codec. 2585func (c Codec) AsCopyAudio() (*CopyAudio, bool) { 2586 return nil, false 2587} 2588 2589// AsH264Video is the BasicCodec implementation for Codec. 2590func (c Codec) AsH264Video() (*H264Video, bool) { 2591 return nil, false 2592} 2593 2594// AsJpgImage is the BasicCodec implementation for Codec. 2595func (c Codec) AsJpgImage() (*JpgImage, bool) { 2596 return nil, false 2597} 2598 2599// AsPngImage is the BasicCodec implementation for Codec. 2600func (c Codec) AsPngImage() (*PngImage, bool) { 2601 return nil, false 2602} 2603 2604// AsCodec is the BasicCodec implementation for Codec. 2605func (c Codec) AsCodec() (*Codec, bool) { 2606 return &c, true 2607} 2608 2609// AsBasicCodec is the BasicCodec implementation for Codec. 2610func (c Codec) AsBasicCodec() (BasicCodec, bool) { 2611 return &c, true 2612} 2613 2614// CommonEncryptionCbcs class for CommonEncryptionCbcs encryption scheme 2615type CommonEncryptionCbcs struct { 2616 // EnabledProtocols - Representing supported protocols 2617 EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"` 2618 // ClearTracks - Representing which tracks should not be encrypted 2619 ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"` 2620 // ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks 2621 ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"` 2622 // Drm - Configuration of DRMs for current encryption scheme 2623 Drm *CbcsDrmConfiguration `json:"drm,omitempty"` 2624} 2625 2626// CommonEncryptionCenc class for envelope encryption scheme 2627type CommonEncryptionCenc struct { 2628 // EnabledProtocols - Representing supported protocols 2629 EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"` 2630 // ClearTracks - Representing which tracks should not be encrypted 2631 ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"` 2632 // ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks 2633 ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"` 2634 // Drm - Configuration of DRMs for CommonEncryptionCenc encryption scheme 2635 Drm *CencDrmConfiguration `json:"drm,omitempty"` 2636} 2637 2638// ContentKeyPolicy a Content Key Policy resource. 2639type ContentKeyPolicy struct { 2640 autorest.Response `json:"-"` 2641 *ContentKeyPolicyProperties `json:"properties,omitempty"` 2642 // ID - READ-ONLY; Fully qualified resource ID for the resource. 2643 ID *string `json:"id,omitempty"` 2644 // Name - READ-ONLY; The name of the resource. 2645 Name *string `json:"name,omitempty"` 2646 // Type - READ-ONLY; The type of the resource. 2647 Type *string `json:"type,omitempty"` 2648} 2649 2650// MarshalJSON is the custom marshaler for ContentKeyPolicy. 2651func (ckp ContentKeyPolicy) MarshalJSON() ([]byte, error) { 2652 objectMap := make(map[string]interface{}) 2653 if ckp.ContentKeyPolicyProperties != nil { 2654 objectMap["properties"] = ckp.ContentKeyPolicyProperties 2655 } 2656 return json.Marshal(objectMap) 2657} 2658 2659// UnmarshalJSON is the custom unmarshaler for ContentKeyPolicy struct. 2660func (ckp *ContentKeyPolicy) UnmarshalJSON(body []byte) error { 2661 var m map[string]*json.RawMessage 2662 err := json.Unmarshal(body, &m) 2663 if err != nil { 2664 return err 2665 } 2666 for k, v := range m { 2667 switch k { 2668 case "properties": 2669 if v != nil { 2670 var contentKeyPolicyProperties ContentKeyPolicyProperties 2671 err = json.Unmarshal(*v, &contentKeyPolicyProperties) 2672 if err != nil { 2673 return err 2674 } 2675 ckp.ContentKeyPolicyProperties = &contentKeyPolicyProperties 2676 } 2677 case "id": 2678 if v != nil { 2679 var ID string 2680 err = json.Unmarshal(*v, &ID) 2681 if err != nil { 2682 return err 2683 } 2684 ckp.ID = &ID 2685 } 2686 case "name": 2687 if v != nil { 2688 var name string 2689 err = json.Unmarshal(*v, &name) 2690 if err != nil { 2691 return err 2692 } 2693 ckp.Name = &name 2694 } 2695 case "type": 2696 if v != nil { 2697 var typeVar string 2698 err = json.Unmarshal(*v, &typeVar) 2699 if err != nil { 2700 return err 2701 } 2702 ckp.Type = &typeVar 2703 } 2704 } 2705 } 2706 2707 return nil 2708} 2709 2710// ContentKeyPolicyClearKeyConfiguration represents a configuration for non-DRM keys. 2711type ContentKeyPolicyClearKeyConfiguration struct { 2712 // OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration' 2713 OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"` 2714} 2715 2716// MarshalJSON is the custom marshaler for ContentKeyPolicyClearKeyConfiguration. 2717func (ckpckc ContentKeyPolicyClearKeyConfiguration) MarshalJSON() ([]byte, error) { 2718 ckpckc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration 2719 objectMap := make(map[string]interface{}) 2720 if ckpckc.OdataType != "" { 2721 objectMap["@odata.type"] = ckpckc.OdataType 2722 } 2723 return json.Marshal(objectMap) 2724} 2725 2726// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration. 2727func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) { 2728 return &ckpckc, true 2729} 2730 2731// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration. 2732func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) { 2733 return nil, false 2734} 2735 2736// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration. 2737func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) { 2738 return nil, false 2739} 2740 2741// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration. 2742func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) { 2743 return nil, false 2744} 2745 2746// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration. 2747func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) { 2748 return nil, false 2749} 2750 2751// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration. 2752func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) { 2753 return nil, false 2754} 2755 2756// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration. 2757func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) { 2758 return &ckpckc, true 2759} 2760 2761// ContentKeyPolicyCollection a collection of ContentKeyPolicy items. 2762type ContentKeyPolicyCollection struct { 2763 autorest.Response `json:"-"` 2764 // Value - A collection of ContentKeyPolicy items. 2765 Value *[]ContentKeyPolicy `json:"value,omitempty"` 2766 // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). 2767 OdataNextLink *string `json:"@odata.nextLink,omitempty"` 2768} 2769 2770// ContentKeyPolicyCollectionIterator provides access to a complete listing of ContentKeyPolicy values. 2771type ContentKeyPolicyCollectionIterator struct { 2772 i int 2773 page ContentKeyPolicyCollectionPage 2774} 2775 2776// NextWithContext advances to the next value. If there was an error making 2777// the request the iterator does not advance and the error is returned. 2778func (iter *ContentKeyPolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2779 if tracing.IsEnabled() { 2780 ctx = tracing.StartSpan(ctx, fqdn+"/ContentKeyPolicyCollectionIterator.NextWithContext") 2781 defer func() { 2782 sc := -1 2783 if iter.Response().Response.Response != nil { 2784 sc = iter.Response().Response.Response.StatusCode 2785 } 2786 tracing.EndSpan(ctx, sc, err) 2787 }() 2788 } 2789 iter.i++ 2790 if iter.i < len(iter.page.Values()) { 2791 return nil 2792 } 2793 err = iter.page.NextWithContext(ctx) 2794 if err != nil { 2795 iter.i-- 2796 return err 2797 } 2798 iter.i = 0 2799 return nil 2800} 2801 2802// Next advances to the next value. If there was an error making 2803// the request the iterator does not advance and the error is returned. 2804// Deprecated: Use NextWithContext() instead. 2805func (iter *ContentKeyPolicyCollectionIterator) Next() error { 2806 return iter.NextWithContext(context.Background()) 2807} 2808 2809// NotDone returns true if the enumeration should be started or is not yet complete. 2810func (iter ContentKeyPolicyCollectionIterator) NotDone() bool { 2811 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2812} 2813 2814// Response returns the raw server response from the last page request. 2815func (iter ContentKeyPolicyCollectionIterator) Response() ContentKeyPolicyCollection { 2816 return iter.page.Response() 2817} 2818 2819// Value returns the current value or a zero-initialized value if the 2820// iterator has advanced beyond the end of the collection. 2821func (iter ContentKeyPolicyCollectionIterator) Value() ContentKeyPolicy { 2822 if !iter.page.NotDone() { 2823 return ContentKeyPolicy{} 2824 } 2825 return iter.page.Values()[iter.i] 2826} 2827 2828// Creates a new instance of the ContentKeyPolicyCollectionIterator type. 2829func NewContentKeyPolicyCollectionIterator(page ContentKeyPolicyCollectionPage) ContentKeyPolicyCollectionIterator { 2830 return ContentKeyPolicyCollectionIterator{page: page} 2831} 2832 2833// IsEmpty returns true if the ListResult contains no values. 2834func (ckpc ContentKeyPolicyCollection) IsEmpty() bool { 2835 return ckpc.Value == nil || len(*ckpc.Value) == 0 2836} 2837 2838// contentKeyPolicyCollectionPreparer prepares a request to retrieve the next set of results. 2839// It returns nil if no more results exist. 2840func (ckpc ContentKeyPolicyCollection) contentKeyPolicyCollectionPreparer(ctx context.Context) (*http.Request, error) { 2841 if ckpc.OdataNextLink == nil || len(to.String(ckpc.OdataNextLink)) < 1 { 2842 return nil, nil 2843 } 2844 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2845 autorest.AsJSON(), 2846 autorest.AsGet(), 2847 autorest.WithBaseURL(to.String(ckpc.OdataNextLink))) 2848} 2849 2850// ContentKeyPolicyCollectionPage contains a page of ContentKeyPolicy values. 2851type ContentKeyPolicyCollectionPage struct { 2852 fn func(context.Context, ContentKeyPolicyCollection) (ContentKeyPolicyCollection, error) 2853 ckpc ContentKeyPolicyCollection 2854} 2855 2856// NextWithContext advances to the next page of values. If there was an error making 2857// the request the page does not advance and the error is returned. 2858func (page *ContentKeyPolicyCollectionPage) NextWithContext(ctx context.Context) (err error) { 2859 if tracing.IsEnabled() { 2860 ctx = tracing.StartSpan(ctx, fqdn+"/ContentKeyPolicyCollectionPage.NextWithContext") 2861 defer func() { 2862 sc := -1 2863 if page.Response().Response.Response != nil { 2864 sc = page.Response().Response.Response.StatusCode 2865 } 2866 tracing.EndSpan(ctx, sc, err) 2867 }() 2868 } 2869 next, err := page.fn(ctx, page.ckpc) 2870 if err != nil { 2871 return err 2872 } 2873 page.ckpc = next 2874 return nil 2875} 2876 2877// Next advances to the next page of values. If there was an error making 2878// the request the page does not advance and the error is returned. 2879// Deprecated: Use NextWithContext() instead. 2880func (page *ContentKeyPolicyCollectionPage) Next() error { 2881 return page.NextWithContext(context.Background()) 2882} 2883 2884// NotDone returns true if the page enumeration should be started or is not yet complete. 2885func (page ContentKeyPolicyCollectionPage) NotDone() bool { 2886 return !page.ckpc.IsEmpty() 2887} 2888 2889// Response returns the raw server response from the last page request. 2890func (page ContentKeyPolicyCollectionPage) Response() ContentKeyPolicyCollection { 2891 return page.ckpc 2892} 2893 2894// Values returns the slice of values for the current page or nil if there are no values. 2895func (page ContentKeyPolicyCollectionPage) Values() []ContentKeyPolicy { 2896 if page.ckpc.IsEmpty() { 2897 return nil 2898 } 2899 return *page.ckpc.Value 2900} 2901 2902// Creates a new instance of the ContentKeyPolicyCollectionPage type. 2903func NewContentKeyPolicyCollectionPage(getNextPage func(context.Context, ContentKeyPolicyCollection) (ContentKeyPolicyCollection, error)) ContentKeyPolicyCollectionPage { 2904 return ContentKeyPolicyCollectionPage{fn: getNextPage} 2905} 2906 2907// BasicContentKeyPolicyConfiguration base class for Content Key Policy configuration. A derived class must be used to 2908// create a configuration. 2909type BasicContentKeyPolicyConfiguration interface { 2910 AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) 2911 AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) 2912 AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) 2913 AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) 2914 AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) 2915 AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) 2916} 2917 2918// ContentKeyPolicyConfiguration base class for Content Key Policy configuration. A derived class must be used 2919// to create a configuration. 2920type ContentKeyPolicyConfiguration struct { 2921 // OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration' 2922 OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"` 2923} 2924 2925func unmarshalBasicContentKeyPolicyConfiguration(body []byte) (BasicContentKeyPolicyConfiguration, error) { 2926 var m map[string]interface{} 2927 err := json.Unmarshal(body, &m) 2928 if err != nil { 2929 return nil, err 2930 } 2931 2932 switch m["@odata.type"] { 2933 case string(OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration): 2934 var ckpckc ContentKeyPolicyClearKeyConfiguration 2935 err := json.Unmarshal(body, &ckpckc) 2936 return ckpckc, err 2937 case string(OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration): 2938 var ckpuc ContentKeyPolicyUnknownConfiguration 2939 err := json.Unmarshal(body, &ckpuc) 2940 return ckpuc, err 2941 case string(OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration): 2942 var ckpwc ContentKeyPolicyWidevineConfiguration 2943 err := json.Unmarshal(body, &ckpwc) 2944 return ckpwc, err 2945 case string(OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration): 2946 var ckpprc ContentKeyPolicyPlayReadyConfiguration 2947 err := json.Unmarshal(body, &ckpprc) 2948 return ckpprc, err 2949 case string(OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration): 2950 var ckpfpc ContentKeyPolicyFairPlayConfiguration 2951 err := json.Unmarshal(body, &ckpfpc) 2952 return ckpfpc, err 2953 default: 2954 var ckpc ContentKeyPolicyConfiguration 2955 err := json.Unmarshal(body, &ckpc) 2956 return ckpc, err 2957 } 2958} 2959func unmarshalBasicContentKeyPolicyConfigurationArray(body []byte) ([]BasicContentKeyPolicyConfiguration, error) { 2960 var rawMessages []*json.RawMessage 2961 err := json.Unmarshal(body, &rawMessages) 2962 if err != nil { 2963 return nil, err 2964 } 2965 2966 ckpcArray := make([]BasicContentKeyPolicyConfiguration, len(rawMessages)) 2967 2968 for index, rawMessage := range rawMessages { 2969 ckpc, err := unmarshalBasicContentKeyPolicyConfiguration(*rawMessage) 2970 if err != nil { 2971 return nil, err 2972 } 2973 ckpcArray[index] = ckpc 2974 } 2975 return ckpcArray, nil 2976} 2977 2978// MarshalJSON is the custom marshaler for ContentKeyPolicyConfiguration. 2979func (ckpc ContentKeyPolicyConfiguration) MarshalJSON() ([]byte, error) { 2980 ckpc.OdataType = OdataTypeContentKeyPolicyConfiguration 2981 objectMap := make(map[string]interface{}) 2982 if ckpc.OdataType != "" { 2983 objectMap["@odata.type"] = ckpc.OdataType 2984 } 2985 return json.Marshal(objectMap) 2986} 2987 2988// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration. 2989func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) { 2990 return nil, false 2991} 2992 2993// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration. 2994func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) { 2995 return nil, false 2996} 2997 2998// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration. 2999func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) { 3000 return nil, false 3001} 3002 3003// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration. 3004func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) { 3005 return nil, false 3006} 3007 3008// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration. 3009func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) { 3010 return nil, false 3011} 3012 3013// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration. 3014func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) { 3015 return &ckpc, true 3016} 3017 3018// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration. 3019func (ckpc ContentKeyPolicyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) { 3020 return &ckpc, true 3021} 3022 3023// ContentKeyPolicyFairPlayConfiguration specifies a configuration for FairPlay licenses. 3024type ContentKeyPolicyFairPlayConfiguration struct { 3025 // Ask - The key that must be used as FairPlay Application Secret key. 3026 Ask *[]byte `json:"ask,omitempty"` 3027 // FairPlayPfxPassword - The password encrypting FairPlay certificate in PKCS 12 (pfx) format. 3028 FairPlayPfxPassword *string `json:"fairPlayPfxPassword,omitempty"` 3029 // FairPlayPfx - The Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key). 3030 FairPlayPfx *string `json:"fairPlayPfx,omitempty"` 3031 // RentalAndLeaseKeyType - The rental and lease key type. Possible values include: 'Unknown', 'Undefined', 'PersistentUnlimited', 'PersistentLimited' 3032 RentalAndLeaseKeyType ContentKeyPolicyFairPlayRentalAndLeaseKeyType `json:"rentalAndLeaseKeyType,omitempty"` 3033 // RentalDuration - The rental duration. Must be greater than or equal to 0. 3034 RentalDuration *int64 `json:"rentalDuration,omitempty"` 3035 // OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration' 3036 OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"` 3037} 3038 3039// MarshalJSON is the custom marshaler for ContentKeyPolicyFairPlayConfiguration. 3040func (ckpfpc ContentKeyPolicyFairPlayConfiguration) MarshalJSON() ([]byte, error) { 3041 ckpfpc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration 3042 objectMap := make(map[string]interface{}) 3043 if ckpfpc.Ask != nil { 3044 objectMap["ask"] = ckpfpc.Ask 3045 } 3046 if ckpfpc.FairPlayPfxPassword != nil { 3047 objectMap["fairPlayPfxPassword"] = ckpfpc.FairPlayPfxPassword 3048 } 3049 if ckpfpc.FairPlayPfx != nil { 3050 objectMap["fairPlayPfx"] = ckpfpc.FairPlayPfx 3051 } 3052 if ckpfpc.RentalAndLeaseKeyType != "" { 3053 objectMap["rentalAndLeaseKeyType"] = ckpfpc.RentalAndLeaseKeyType 3054 } 3055 if ckpfpc.RentalDuration != nil { 3056 objectMap["rentalDuration"] = ckpfpc.RentalDuration 3057 } 3058 if ckpfpc.OdataType != "" { 3059 objectMap["@odata.type"] = ckpfpc.OdataType 3060 } 3061 return json.Marshal(objectMap) 3062} 3063 3064// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration. 3065func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) { 3066 return nil, false 3067} 3068 3069// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration. 3070func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) { 3071 return nil, false 3072} 3073 3074// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration. 3075func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) { 3076 return nil, false 3077} 3078 3079// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration. 3080func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) { 3081 return nil, false 3082} 3083 3084// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration. 3085func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) { 3086 return &ckpfpc, true 3087} 3088 3089// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration. 3090func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) { 3091 return nil, false 3092} 3093 3094// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration. 3095func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) { 3096 return &ckpfpc, true 3097} 3098 3099// ContentKeyPolicyOpenRestriction represents an open restriction. License or key will be delivered on 3100// every request. 3101type ContentKeyPolicyOpenRestriction struct { 3102 // OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction' 3103 OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"` 3104} 3105 3106// MarshalJSON is the custom marshaler for ContentKeyPolicyOpenRestriction. 3107func (ckpor ContentKeyPolicyOpenRestriction) MarshalJSON() ([]byte, error) { 3108 ckpor.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction 3109 objectMap := make(map[string]interface{}) 3110 if ckpor.OdataType != "" { 3111 objectMap["@odata.type"] = ckpor.OdataType 3112 } 3113 return json.Marshal(objectMap) 3114} 3115 3116// AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction. 3117func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) { 3118 return &ckpor, true 3119} 3120 3121// AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction. 3122func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) { 3123 return nil, false 3124} 3125 3126// AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction. 3127func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) { 3128 return nil, false 3129} 3130 3131// AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction. 3132func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) { 3133 return nil, false 3134} 3135 3136// AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction. 3137func (ckpor ContentKeyPolicyOpenRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) { 3138 return &ckpor, true 3139} 3140 3141// ContentKeyPolicyOption represents a policy option. 3142type ContentKeyPolicyOption struct { 3143 // PolicyOptionID - READ-ONLY; The legacy Policy Option ID. 3144 PolicyOptionID *uuid.UUID `json:"policyOptionId,omitempty"` 3145 // Name - The Policy Option description. 3146 Name *string `json:"name,omitempty"` 3147 // Configuration - The key delivery configuration. 3148 Configuration BasicContentKeyPolicyConfiguration `json:"configuration,omitempty"` 3149 // Restriction - The requirements that must be met to deliver keys with this configuration 3150 Restriction BasicContentKeyPolicyRestriction `json:"restriction,omitempty"` 3151} 3152 3153// UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyOption struct. 3154func (ckpo *ContentKeyPolicyOption) UnmarshalJSON(body []byte) error { 3155 var m map[string]*json.RawMessage 3156 err := json.Unmarshal(body, &m) 3157 if err != nil { 3158 return err 3159 } 3160 for k, v := range m { 3161 switch k { 3162 case "policyOptionId": 3163 if v != nil { 3164 var policyOptionID uuid.UUID 3165 err = json.Unmarshal(*v, &policyOptionID) 3166 if err != nil { 3167 return err 3168 } 3169 ckpo.PolicyOptionID = &policyOptionID 3170 } 3171 case "name": 3172 if v != nil { 3173 var name string 3174 err = json.Unmarshal(*v, &name) 3175 if err != nil { 3176 return err 3177 } 3178 ckpo.Name = &name 3179 } 3180 case "configuration": 3181 if v != nil { 3182 configuration, err := unmarshalBasicContentKeyPolicyConfiguration(*v) 3183 if err != nil { 3184 return err 3185 } 3186 ckpo.Configuration = configuration 3187 } 3188 case "restriction": 3189 if v != nil { 3190 restriction, err := unmarshalBasicContentKeyPolicyRestriction(*v) 3191 if err != nil { 3192 return err 3193 } 3194 ckpo.Restriction = restriction 3195 } 3196 } 3197 } 3198 3199 return nil 3200} 3201 3202// ContentKeyPolicyPlayReadyConfiguration specifies a configuration for PlayReady licenses. 3203type ContentKeyPolicyPlayReadyConfiguration struct { 3204 // Licenses - The PlayReady licenses. 3205 Licenses *[]ContentKeyPolicyPlayReadyLicense `json:"licenses,omitempty"` 3206 // ResponseCustomData - The custom response data. 3207 ResponseCustomData *string `json:"responseCustomData,omitempty"` 3208 // OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration' 3209 OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"` 3210} 3211 3212// MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyConfiguration. 3213func (ckpprc ContentKeyPolicyPlayReadyConfiguration) MarshalJSON() ([]byte, error) { 3214 ckpprc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration 3215 objectMap := make(map[string]interface{}) 3216 if ckpprc.Licenses != nil { 3217 objectMap["licenses"] = ckpprc.Licenses 3218 } 3219 if ckpprc.ResponseCustomData != nil { 3220 objectMap["responseCustomData"] = ckpprc.ResponseCustomData 3221 } 3222 if ckpprc.OdataType != "" { 3223 objectMap["@odata.type"] = ckpprc.OdataType 3224 } 3225 return json.Marshal(objectMap) 3226} 3227 3228// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration. 3229func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) { 3230 return nil, false 3231} 3232 3233// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration. 3234func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) { 3235 return nil, false 3236} 3237 3238// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration. 3239func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) { 3240 return nil, false 3241} 3242 3243// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration. 3244func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) { 3245 return &ckpprc, true 3246} 3247 3248// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration. 3249func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) { 3250 return nil, false 3251} 3252 3253// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration. 3254func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) { 3255 return nil, false 3256} 3257 3258// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration. 3259func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) { 3260 return &ckpprc, true 3261} 3262 3263// ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader specifies that the content key ID is in the 3264// PlayReady header. 3265type ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader struct { 3266 // OdataType - Possible values include: 'OdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier' 3267 OdataType OdataType `json:"@odata.type,omitempty"` 3268} 3269 3270// MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader. 3271func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) MarshalJSON() ([]byte, error) { 3272 ckpprcekfh.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader 3273 objectMap := make(map[string]interface{}) 3274 if ckpprcekfh.OdataType != "" { 3275 objectMap["@odata.type"] = ckpprcekfh.OdataType 3276 } 3277 return json.Marshal(objectMap) 3278} 3279 3280// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader. 3281func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) { 3282 return &ckpprcekfh, true 3283} 3284 3285// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader. 3286func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) { 3287 return nil, false 3288} 3289 3290// AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader. 3291func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) { 3292 return nil, false 3293} 3294 3295// AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader. 3296func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) { 3297 return &ckpprcekfh, true 3298} 3299 3300// ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier specifies that the content key ID is 3301// specified in the PlayReady configuration. 3302type ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier struct { 3303 // KeyID - The content key ID. 3304 KeyID *uuid.UUID `json:"keyId,omitempty"` 3305 // OdataType - Possible values include: 'OdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier' 3306 OdataType OdataType `json:"@odata.type,omitempty"` 3307} 3308 3309// MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier. 3310func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) MarshalJSON() ([]byte, error) { 3311 ckpprcekfki.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier 3312 objectMap := make(map[string]interface{}) 3313 if ckpprcekfki.KeyID != nil { 3314 objectMap["keyId"] = ckpprcekfki.KeyID 3315 } 3316 if ckpprcekfki.OdataType != "" { 3317 objectMap["@odata.type"] = ckpprcekfki.OdataType 3318 } 3319 return json.Marshal(objectMap) 3320} 3321 3322// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier. 3323func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) { 3324 return nil, false 3325} 3326 3327// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier. 3328func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) { 3329 return &ckpprcekfki, true 3330} 3331 3332// AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier. 3333func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) { 3334 return nil, false 3335} 3336 3337// AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier. 3338func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) { 3339 return &ckpprcekfki, true 3340} 3341 3342// BasicContentKeyPolicyPlayReadyContentKeyLocation base class for content key ID location. A derived class must be 3343// used to represent the location. 3344type BasicContentKeyPolicyPlayReadyContentKeyLocation interface { 3345 AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) 3346 AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) 3347 AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) 3348} 3349 3350// ContentKeyPolicyPlayReadyContentKeyLocation base class for content key ID location. A derived class must be 3351// used to represent the location. 3352type ContentKeyPolicyPlayReadyContentKeyLocation struct { 3353 // OdataType - Possible values include: 'OdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier' 3354 OdataType OdataType `json:"@odata.type,omitempty"` 3355} 3356 3357func unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(body []byte) (BasicContentKeyPolicyPlayReadyContentKeyLocation, error) { 3358 var m map[string]interface{} 3359 err := json.Unmarshal(body, &m) 3360 if err != nil { 3361 return nil, err 3362 } 3363 3364 switch m["@odata.type"] { 3365 case string(OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader): 3366 var ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader 3367 err := json.Unmarshal(body, &ckpprcekfh) 3368 return ckpprcekfh, err 3369 case string(OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier): 3370 var ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier 3371 err := json.Unmarshal(body, &ckpprcekfki) 3372 return ckpprcekfki, err 3373 default: 3374 var ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation 3375 err := json.Unmarshal(body, &ckpprckl) 3376 return ckpprckl, err 3377 } 3378} 3379func unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocationArray(body []byte) ([]BasicContentKeyPolicyPlayReadyContentKeyLocation, error) { 3380 var rawMessages []*json.RawMessage 3381 err := json.Unmarshal(body, &rawMessages) 3382 if err != nil { 3383 return nil, err 3384 } 3385 3386 ckpprcklArray := make([]BasicContentKeyPolicyPlayReadyContentKeyLocation, len(rawMessages)) 3387 3388 for index, rawMessage := range rawMessages { 3389 ckpprckl, err := unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(*rawMessage) 3390 if err != nil { 3391 return nil, err 3392 } 3393 ckpprcklArray[index] = ckpprckl 3394 } 3395 return ckpprcklArray, nil 3396} 3397 3398// MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentKeyLocation. 3399func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) MarshalJSON() ([]byte, error) { 3400 ckpprckl.OdataType = OdataTypeContentKeyPolicyPlayReadyContentKeyLocation 3401 objectMap := make(map[string]interface{}) 3402 if ckpprckl.OdataType != "" { 3403 objectMap["@odata.type"] = ckpprckl.OdataType 3404 } 3405 return json.Marshal(objectMap) 3406} 3407 3408// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation. 3409func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) { 3410 return nil, false 3411} 3412 3413// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation. 3414func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) { 3415 return nil, false 3416} 3417 3418// AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation. 3419func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) { 3420 return &ckpprckl, true 3421} 3422 3423// AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation. 3424func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) { 3425 return &ckpprckl, true 3426} 3427 3428// ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction configures the Explicit Analog Television 3429// Output Restriction control bits. For further details see the PlayReady Compliance Rules. 3430type ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction struct { 3431 // BestEffort - Indicates whether this restriction is enforced on a Best Effort basis. 3432 BestEffort *bool `json:"bestEffort,omitempty"` 3433 // ConfigurationData - Configures the restriction control bits. Must be between 0 and 3 inclusive. 3434 ConfigurationData *int32 `json:"configurationData,omitempty"` 3435} 3436 3437// ContentKeyPolicyPlayReadyLicense the PlayReady license 3438type ContentKeyPolicyPlayReadyLicense struct { 3439 // AllowTestDevices - A flag indicating whether test devices can use the license. 3440 AllowTestDevices *bool `json:"allowTestDevices,omitempty"` 3441 // BeginDate - The begin date of license 3442 BeginDate *date.Time `json:"beginDate,omitempty"` 3443 // ExpirationDate - The expiration date of license. 3444 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 3445 // RelativeBeginDate - The relative begin date of license. 3446 RelativeBeginDate *string `json:"relativeBeginDate,omitempty"` 3447 // RelativeExpirationDate - The relative expiration date of license. 3448 RelativeExpirationDate *string `json:"relativeExpirationDate,omitempty"` 3449 // GracePeriod - The grace period of license. 3450 GracePeriod *string `json:"gracePeriod,omitempty"` 3451 // PlayRight - The license PlayRight 3452 PlayRight *ContentKeyPolicyPlayReadyPlayRight `json:"playRight,omitempty"` 3453 // LicenseType - The license type. Possible values include: 'ContentKeyPolicyPlayReadyLicenseTypeUnknown', 'ContentKeyPolicyPlayReadyLicenseTypeNonPersistent', 'ContentKeyPolicyPlayReadyLicenseTypePersistent' 3454 LicenseType ContentKeyPolicyPlayReadyLicenseType `json:"licenseType,omitempty"` 3455 // ContentKeyLocation - The content key location. 3456 ContentKeyLocation BasicContentKeyPolicyPlayReadyContentKeyLocation `json:"contentKeyLocation,omitempty"` 3457 // ContentType - The PlayReady content type. Possible values include: 'ContentKeyPolicyPlayReadyContentTypeUnknown', 'ContentKeyPolicyPlayReadyContentTypeUnspecified', 'ContentKeyPolicyPlayReadyContentTypeUltraVioletDownload', 'ContentKeyPolicyPlayReadyContentTypeUltraVioletStreaming' 3458 ContentType ContentKeyPolicyPlayReadyContentType `json:"contentType,omitempty"` 3459} 3460 3461// UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyPlayReadyLicense struct. 3462func (ckpprl *ContentKeyPolicyPlayReadyLicense) UnmarshalJSON(body []byte) error { 3463 var m map[string]*json.RawMessage 3464 err := json.Unmarshal(body, &m) 3465 if err != nil { 3466 return err 3467 } 3468 for k, v := range m { 3469 switch k { 3470 case "allowTestDevices": 3471 if v != nil { 3472 var allowTestDevices bool 3473 err = json.Unmarshal(*v, &allowTestDevices) 3474 if err != nil { 3475 return err 3476 } 3477 ckpprl.AllowTestDevices = &allowTestDevices 3478 } 3479 case "beginDate": 3480 if v != nil { 3481 var beginDate date.Time 3482 err = json.Unmarshal(*v, &beginDate) 3483 if err != nil { 3484 return err 3485 } 3486 ckpprl.BeginDate = &beginDate 3487 } 3488 case "expirationDate": 3489 if v != nil { 3490 var expirationDate date.Time 3491 err = json.Unmarshal(*v, &expirationDate) 3492 if err != nil { 3493 return err 3494 } 3495 ckpprl.ExpirationDate = &expirationDate 3496 } 3497 case "relativeBeginDate": 3498 if v != nil { 3499 var relativeBeginDate string 3500 err = json.Unmarshal(*v, &relativeBeginDate) 3501 if err != nil { 3502 return err 3503 } 3504 ckpprl.RelativeBeginDate = &relativeBeginDate 3505 } 3506 case "relativeExpirationDate": 3507 if v != nil { 3508 var relativeExpirationDate string 3509 err = json.Unmarshal(*v, &relativeExpirationDate) 3510 if err != nil { 3511 return err 3512 } 3513 ckpprl.RelativeExpirationDate = &relativeExpirationDate 3514 } 3515 case "gracePeriod": 3516 if v != nil { 3517 var gracePeriod string 3518 err = json.Unmarshal(*v, &gracePeriod) 3519 if err != nil { 3520 return err 3521 } 3522 ckpprl.GracePeriod = &gracePeriod 3523 } 3524 case "playRight": 3525 if v != nil { 3526 var playRight ContentKeyPolicyPlayReadyPlayRight 3527 err = json.Unmarshal(*v, &playRight) 3528 if err != nil { 3529 return err 3530 } 3531 ckpprl.PlayRight = &playRight 3532 } 3533 case "licenseType": 3534 if v != nil { 3535 var licenseType ContentKeyPolicyPlayReadyLicenseType 3536 err = json.Unmarshal(*v, &licenseType) 3537 if err != nil { 3538 return err 3539 } 3540 ckpprl.LicenseType = licenseType 3541 } 3542 case "contentKeyLocation": 3543 if v != nil { 3544 contentKeyLocation, err := unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(*v) 3545 if err != nil { 3546 return err 3547 } 3548 ckpprl.ContentKeyLocation = contentKeyLocation 3549 } 3550 case "contentType": 3551 if v != nil { 3552 var contentType ContentKeyPolicyPlayReadyContentType 3553 err = json.Unmarshal(*v, &contentType) 3554 if err != nil { 3555 return err 3556 } 3557 ckpprl.ContentType = contentType 3558 } 3559 } 3560 } 3561 3562 return nil 3563} 3564 3565// ContentKeyPolicyPlayReadyPlayRight configures the Play Right in the PlayReady license. 3566type ContentKeyPolicyPlayReadyPlayRight struct { 3567 // FirstPlayExpiration - The amount of time that the license is valid after the license is first used to play content. 3568 FirstPlayExpiration *string `json:"firstPlayExpiration,omitempty"` 3569 // ScmsRestriction - Configures the Serial Copy Management System (SCMS) in the license. Must be between 0 and 3 inclusive. 3570 ScmsRestriction *int32 `json:"scmsRestriction,omitempty"` 3571 // AgcAndColorStripeRestriction - Configures Automatic Gain Control (AGC) and Color Stripe in the license. Must be between 0 and 3 inclusive. 3572 AgcAndColorStripeRestriction *int32 `json:"agcAndColorStripeRestriction,omitempty"` 3573 // ExplicitAnalogTelevisionOutputRestriction - Configures the Explicit Analog Television Output Restriction in the license. Configuration data must be between 0 and 3 inclusive. 3574 ExplicitAnalogTelevisionOutputRestriction *ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction `json:"explicitAnalogTelevisionOutputRestriction,omitempty"` 3575 // DigitalVideoOnlyContentRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license. 3576 DigitalVideoOnlyContentRestriction *bool `json:"digitalVideoOnlyContentRestriction,omitempty"` 3577 // ImageConstraintForAnalogComponentVideoRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license. 3578 ImageConstraintForAnalogComponentVideoRestriction *bool `json:"imageConstraintForAnalogComponentVideoRestriction,omitempty"` 3579 // ImageConstraintForAnalogComputerMonitorRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license. 3580 ImageConstraintForAnalogComputerMonitorRestriction *bool `json:"imageConstraintForAnalogComputerMonitorRestriction,omitempty"` 3581 // AllowPassingVideoContentToUnknownOutput - Configures Unknown output handling settings of the license. Possible values include: 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionUnknown', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionNotAllowed', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowed', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowedWithVideoConstriction' 3582 AllowPassingVideoContentToUnknownOutput ContentKeyPolicyPlayReadyUnknownOutputPassingOption `json:"allowPassingVideoContentToUnknownOutput,omitempty"` 3583 // UncompressedDigitalVideoOpl - Specifies the output protection level for uncompressed digital video. 3584 UncompressedDigitalVideoOpl *int32 `json:"uncompressedDigitalVideoOpl,omitempty"` 3585 // CompressedDigitalVideoOpl - Specifies the output protection level for compressed digital video. 3586 CompressedDigitalVideoOpl *int32 `json:"compressedDigitalVideoOpl,omitempty"` 3587 // AnalogVideoOpl - Specifies the output protection level for compressed digital audio. 3588 AnalogVideoOpl *int32 `json:"analogVideoOpl,omitempty"` 3589 // CompressedDigitalAudioOpl - Specifies the output protection level for compressed digital audio. 3590 CompressedDigitalAudioOpl *int32 `json:"compressedDigitalAudioOpl,omitempty"` 3591 // UncompressedDigitalAudioOpl - Specifies the output protection level for uncompressed digital audio. 3592 UncompressedDigitalAudioOpl *int32 `json:"uncompressedDigitalAudioOpl,omitempty"` 3593} 3594 3595// ContentKeyPolicyProperties the properties of the Content Key Policy. 3596type ContentKeyPolicyProperties struct { 3597 autorest.Response `json:"-"` 3598 // PolicyID - READ-ONLY; The legacy Policy ID. 3599 PolicyID *uuid.UUID `json:"policyId,omitempty"` 3600 // Created - READ-ONLY; The creation date of the Policy 3601 Created *date.Time `json:"created,omitempty"` 3602 // LastModified - READ-ONLY; The last modified date of the Policy 3603 LastModified *date.Time `json:"lastModified,omitempty"` 3604 // Description - A description for the Policy. 3605 Description *string `json:"description,omitempty"` 3606 // Options - The Key Policy options. 3607 Options *[]ContentKeyPolicyOption `json:"options,omitempty"` 3608} 3609 3610// BasicContentKeyPolicyRestriction base class for Content Key Policy restrictions. A derived class must be used to 3611// create a restriction. 3612type BasicContentKeyPolicyRestriction interface { 3613 AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) 3614 AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) 3615 AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) 3616 AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) 3617} 3618 3619// ContentKeyPolicyRestriction base class for Content Key Policy restrictions. A derived class must be used to 3620// create a restriction. 3621type ContentKeyPolicyRestriction struct { 3622 // OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction' 3623 OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"` 3624} 3625 3626func unmarshalBasicContentKeyPolicyRestriction(body []byte) (BasicContentKeyPolicyRestriction, error) { 3627 var m map[string]interface{} 3628 err := json.Unmarshal(body, &m) 3629 if err != nil { 3630 return nil, err 3631 } 3632 3633 switch m["@odata.type"] { 3634 case string(OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction): 3635 var ckpor ContentKeyPolicyOpenRestriction 3636 err := json.Unmarshal(body, &ckpor) 3637 return ckpor, err 3638 case string(OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction): 3639 var ckpur ContentKeyPolicyUnknownRestriction 3640 err := json.Unmarshal(body, &ckpur) 3641 return ckpur, err 3642 case string(OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction): 3643 var ckptr ContentKeyPolicyTokenRestriction 3644 err := json.Unmarshal(body, &ckptr) 3645 return ckptr, err 3646 default: 3647 var ckpr ContentKeyPolicyRestriction 3648 err := json.Unmarshal(body, &ckpr) 3649 return ckpr, err 3650 } 3651} 3652func unmarshalBasicContentKeyPolicyRestrictionArray(body []byte) ([]BasicContentKeyPolicyRestriction, error) { 3653 var rawMessages []*json.RawMessage 3654 err := json.Unmarshal(body, &rawMessages) 3655 if err != nil { 3656 return nil, err 3657 } 3658 3659 ckprArray := make([]BasicContentKeyPolicyRestriction, len(rawMessages)) 3660 3661 for index, rawMessage := range rawMessages { 3662 ckpr, err := unmarshalBasicContentKeyPolicyRestriction(*rawMessage) 3663 if err != nil { 3664 return nil, err 3665 } 3666 ckprArray[index] = ckpr 3667 } 3668 return ckprArray, nil 3669} 3670 3671// MarshalJSON is the custom marshaler for ContentKeyPolicyRestriction. 3672func (ckpr ContentKeyPolicyRestriction) MarshalJSON() ([]byte, error) { 3673 ckpr.OdataType = OdataTypeContentKeyPolicyRestriction 3674 objectMap := make(map[string]interface{}) 3675 if ckpr.OdataType != "" { 3676 objectMap["@odata.type"] = ckpr.OdataType 3677 } 3678 return json.Marshal(objectMap) 3679} 3680 3681// AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction. 3682func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) { 3683 return nil, false 3684} 3685 3686// AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction. 3687func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) { 3688 return nil, false 3689} 3690 3691// AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction. 3692func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) { 3693 return nil, false 3694} 3695 3696// AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction. 3697func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) { 3698 return &ckpr, true 3699} 3700 3701// AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction. 3702func (ckpr ContentKeyPolicyRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) { 3703 return &ckpr, true 3704} 3705 3706// BasicContentKeyPolicyRestrictionTokenKey base class for Content Key Policy key for token validation. A derived class 3707// must be used to create a token key. 3708type BasicContentKeyPolicyRestrictionTokenKey interface { 3709 AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) 3710 AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) 3711 AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) 3712 AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) 3713} 3714 3715// ContentKeyPolicyRestrictionTokenKey base class for Content Key Policy key for token validation. A derived 3716// class must be used to create a token key. 3717type ContentKeyPolicyRestrictionTokenKey struct { 3718 // OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey' 3719 OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"` 3720} 3721 3722func unmarshalBasicContentKeyPolicyRestrictionTokenKey(body []byte) (BasicContentKeyPolicyRestrictionTokenKey, error) { 3723 var m map[string]interface{} 3724 err := json.Unmarshal(body, &m) 3725 if err != nil { 3726 return nil, err 3727 } 3728 3729 switch m["@odata.type"] { 3730 case string(OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey): 3731 var ckpstk ContentKeyPolicySymmetricTokenKey 3732 err := json.Unmarshal(body, &ckpstk) 3733 return ckpstk, err 3734 case string(OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey): 3735 var ckprtk ContentKeyPolicyRsaTokenKey 3736 err := json.Unmarshal(body, &ckprtk) 3737 return ckprtk, err 3738 case string(OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey): 3739 var ckpxctk ContentKeyPolicyX509CertificateTokenKey 3740 err := json.Unmarshal(body, &ckpxctk) 3741 return ckpxctk, err 3742 default: 3743 var ckprtk ContentKeyPolicyRestrictionTokenKey 3744 err := json.Unmarshal(body, &ckprtk) 3745 return ckprtk, err 3746 } 3747} 3748func unmarshalBasicContentKeyPolicyRestrictionTokenKeyArray(body []byte) ([]BasicContentKeyPolicyRestrictionTokenKey, error) { 3749 var rawMessages []*json.RawMessage 3750 err := json.Unmarshal(body, &rawMessages) 3751 if err != nil { 3752 return nil, err 3753 } 3754 3755 ckprtkArray := make([]BasicContentKeyPolicyRestrictionTokenKey, len(rawMessages)) 3756 3757 for index, rawMessage := range rawMessages { 3758 ckprtk, err := unmarshalBasicContentKeyPolicyRestrictionTokenKey(*rawMessage) 3759 if err != nil { 3760 return nil, err 3761 } 3762 ckprtkArray[index] = ckprtk 3763 } 3764 return ckprtkArray, nil 3765} 3766 3767// MarshalJSON is the custom marshaler for ContentKeyPolicyRestrictionTokenKey. 3768func (ckprtk ContentKeyPolicyRestrictionTokenKey) MarshalJSON() ([]byte, error) { 3769 ckprtk.OdataType = OdataTypeContentKeyPolicyRestrictionTokenKey 3770 objectMap := make(map[string]interface{}) 3771 if ckprtk.OdataType != "" { 3772 objectMap["@odata.type"] = ckprtk.OdataType 3773 } 3774 return json.Marshal(objectMap) 3775} 3776 3777// AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey. 3778func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) { 3779 return nil, false 3780} 3781 3782// AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey. 3783func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) { 3784 return nil, false 3785} 3786 3787// AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey. 3788func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) { 3789 return nil, false 3790} 3791 3792// AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey. 3793func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) { 3794 return &ckprtk, true 3795} 3796 3797// AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey. 3798func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) { 3799 return &ckprtk, true 3800} 3801 3802// ContentKeyPolicyRsaTokenKey specifies a RSA key for token validation 3803type ContentKeyPolicyRsaTokenKey struct { 3804 // Exponent - The RSA Parameter exponent 3805 Exponent *[]byte `json:"exponent,omitempty"` 3806 // Modulus - The RSA Parameter modulus 3807 Modulus *[]byte `json:"modulus,omitempty"` 3808 // OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey' 3809 OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"` 3810} 3811 3812// MarshalJSON is the custom marshaler for ContentKeyPolicyRsaTokenKey. 3813func (ckprtk ContentKeyPolicyRsaTokenKey) MarshalJSON() ([]byte, error) { 3814 ckprtk.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey 3815 objectMap := make(map[string]interface{}) 3816 if ckprtk.Exponent != nil { 3817 objectMap["exponent"] = ckprtk.Exponent 3818 } 3819 if ckprtk.Modulus != nil { 3820 objectMap["modulus"] = ckprtk.Modulus 3821 } 3822 if ckprtk.OdataType != "" { 3823 objectMap["@odata.type"] = ckprtk.OdataType 3824 } 3825 return json.Marshal(objectMap) 3826} 3827 3828// AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey. 3829func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) { 3830 return nil, false 3831} 3832 3833// AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey. 3834func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) { 3835 return &ckprtk, true 3836} 3837 3838// AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey. 3839func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) { 3840 return nil, false 3841} 3842 3843// AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey. 3844func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) { 3845 return nil, false 3846} 3847 3848// AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey. 3849func (ckprtk ContentKeyPolicyRsaTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) { 3850 return &ckprtk, true 3851} 3852 3853// ContentKeyPolicySymmetricTokenKey specifies a symmetric key for token validation. 3854type ContentKeyPolicySymmetricTokenKey struct { 3855 // KeyValue - The key value of the key 3856 KeyValue *[]byte `json:"keyValue,omitempty"` 3857 // OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey' 3858 OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"` 3859} 3860 3861// MarshalJSON is the custom marshaler for ContentKeyPolicySymmetricTokenKey. 3862func (ckpstk ContentKeyPolicySymmetricTokenKey) MarshalJSON() ([]byte, error) { 3863 ckpstk.OdataType = OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey 3864 objectMap := make(map[string]interface{}) 3865 if ckpstk.KeyValue != nil { 3866 objectMap["keyValue"] = ckpstk.KeyValue 3867 } 3868 if ckpstk.OdataType != "" { 3869 objectMap["@odata.type"] = ckpstk.OdataType 3870 } 3871 return json.Marshal(objectMap) 3872} 3873 3874// AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey. 3875func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) { 3876 return &ckpstk, true 3877} 3878 3879// AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey. 3880func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) { 3881 return nil, false 3882} 3883 3884// AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey. 3885func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) { 3886 return nil, false 3887} 3888 3889// AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey. 3890func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) { 3891 return nil, false 3892} 3893 3894// AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey. 3895func (ckpstk ContentKeyPolicySymmetricTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) { 3896 return &ckpstk, true 3897} 3898 3899// ContentKeyPolicyTokenClaim represents a token claim. 3900type ContentKeyPolicyTokenClaim struct { 3901 // ClaimType - Token claim type. 3902 ClaimType *string `json:"claimType,omitempty"` 3903 // ClaimValue - Token claim value. 3904 ClaimValue *string `json:"claimValue,omitempty"` 3905} 3906 3907// ContentKeyPolicyTokenRestriction represents a token restriction. Provided token must match these 3908// requirements for successful license or key delivery. 3909type ContentKeyPolicyTokenRestriction struct { 3910 // Issuer - The token issuer. 3911 Issuer *string `json:"issuer,omitempty"` 3912 // Audience - The audience for the token. 3913 Audience *string `json:"audience,omitempty"` 3914 // PrimaryVerificationKey - The primary verification key. 3915 PrimaryVerificationKey BasicContentKeyPolicyRestrictionTokenKey `json:"primaryVerificationKey,omitempty"` 3916 // AlternateVerificationKeys - A list of alternative verification keys. 3917 AlternateVerificationKeys *[]BasicContentKeyPolicyRestrictionTokenKey `json:"alternateVerificationKeys,omitempty"` 3918 // RequiredClaims - A list of required token claims. 3919 RequiredClaims *[]ContentKeyPolicyTokenClaim `json:"requiredClaims,omitempty"` 3920 // RestrictionTokenType - The type of token. Possible values include: 'ContentKeyPolicyRestrictionTokenTypeUnknown', 'ContentKeyPolicyRestrictionTokenTypeSwt', 'ContentKeyPolicyRestrictionTokenTypeJwt' 3921 RestrictionTokenType ContentKeyPolicyRestrictionTokenType `json:"restrictionTokenType,omitempty"` 3922 // OpenIDConnectDiscoveryDocument - The OpenID connect discovery document. 3923 OpenIDConnectDiscoveryDocument *string `json:"openIdConnectDiscoveryDocument,omitempty"` 3924 // OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction' 3925 OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"` 3926} 3927 3928// MarshalJSON is the custom marshaler for ContentKeyPolicyTokenRestriction. 3929func (ckptr ContentKeyPolicyTokenRestriction) MarshalJSON() ([]byte, error) { 3930 ckptr.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction 3931 objectMap := make(map[string]interface{}) 3932 if ckptr.Issuer != nil { 3933 objectMap["issuer"] = ckptr.Issuer 3934 } 3935 if ckptr.Audience != nil { 3936 objectMap["audience"] = ckptr.Audience 3937 } 3938 objectMap["primaryVerificationKey"] = ckptr.PrimaryVerificationKey 3939 if ckptr.AlternateVerificationKeys != nil { 3940 objectMap["alternateVerificationKeys"] = ckptr.AlternateVerificationKeys 3941 } 3942 if ckptr.RequiredClaims != nil { 3943 objectMap["requiredClaims"] = ckptr.RequiredClaims 3944 } 3945 if ckptr.RestrictionTokenType != "" { 3946 objectMap["restrictionTokenType"] = ckptr.RestrictionTokenType 3947 } 3948 if ckptr.OpenIDConnectDiscoveryDocument != nil { 3949 objectMap["openIdConnectDiscoveryDocument"] = ckptr.OpenIDConnectDiscoveryDocument 3950 } 3951 if ckptr.OdataType != "" { 3952 objectMap["@odata.type"] = ckptr.OdataType 3953 } 3954 return json.Marshal(objectMap) 3955} 3956 3957// AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction. 3958func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) { 3959 return nil, false 3960} 3961 3962// AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction. 3963func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) { 3964 return nil, false 3965} 3966 3967// AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction. 3968func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) { 3969 return &ckptr, true 3970} 3971 3972// AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction. 3973func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) { 3974 return nil, false 3975} 3976 3977// AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction. 3978func (ckptr ContentKeyPolicyTokenRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) { 3979 return &ckptr, true 3980} 3981 3982// UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyTokenRestriction struct. 3983func (ckptr *ContentKeyPolicyTokenRestriction) UnmarshalJSON(body []byte) error { 3984 var m map[string]*json.RawMessage 3985 err := json.Unmarshal(body, &m) 3986 if err != nil { 3987 return err 3988 } 3989 for k, v := range m { 3990 switch k { 3991 case "issuer": 3992 if v != nil { 3993 var issuer string 3994 err = json.Unmarshal(*v, &issuer) 3995 if err != nil { 3996 return err 3997 } 3998 ckptr.Issuer = &issuer 3999 } 4000 case "audience": 4001 if v != nil { 4002 var audience string 4003 err = json.Unmarshal(*v, &audience) 4004 if err != nil { 4005 return err 4006 } 4007 ckptr.Audience = &audience 4008 } 4009 case "primaryVerificationKey": 4010 if v != nil { 4011 primaryVerificationKey, err := unmarshalBasicContentKeyPolicyRestrictionTokenKey(*v) 4012 if err != nil { 4013 return err 4014 } 4015 ckptr.PrimaryVerificationKey = primaryVerificationKey 4016 } 4017 case "alternateVerificationKeys": 4018 if v != nil { 4019 alternateVerificationKeys, err := unmarshalBasicContentKeyPolicyRestrictionTokenKeyArray(*v) 4020 if err != nil { 4021 return err 4022 } 4023 ckptr.AlternateVerificationKeys = &alternateVerificationKeys 4024 } 4025 case "requiredClaims": 4026 if v != nil { 4027 var requiredClaims []ContentKeyPolicyTokenClaim 4028 err = json.Unmarshal(*v, &requiredClaims) 4029 if err != nil { 4030 return err 4031 } 4032 ckptr.RequiredClaims = &requiredClaims 4033 } 4034 case "restrictionTokenType": 4035 if v != nil { 4036 var restrictionTokenType ContentKeyPolicyRestrictionTokenType 4037 err = json.Unmarshal(*v, &restrictionTokenType) 4038 if err != nil { 4039 return err 4040 } 4041 ckptr.RestrictionTokenType = restrictionTokenType 4042 } 4043 case "openIdConnectDiscoveryDocument": 4044 if v != nil { 4045 var openIDConnectDiscoveryDocument string 4046 err = json.Unmarshal(*v, &openIDConnectDiscoveryDocument) 4047 if err != nil { 4048 return err 4049 } 4050 ckptr.OpenIDConnectDiscoveryDocument = &openIDConnectDiscoveryDocument 4051 } 4052 case "@odata.type": 4053 if v != nil { 4054 var odataType OdataTypeBasicContentKeyPolicyRestriction 4055 err = json.Unmarshal(*v, &odataType) 4056 if err != nil { 4057 return err 4058 } 4059 ckptr.OdataType = odataType 4060 } 4061 } 4062 } 4063 4064 return nil 4065} 4066 4067// ContentKeyPolicyUnknownConfiguration represents a ContentKeyPolicyConfiguration that is unavailable in 4068// the current API version. 4069type ContentKeyPolicyUnknownConfiguration struct { 4070 // OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration' 4071 OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"` 4072} 4073 4074// MarshalJSON is the custom marshaler for ContentKeyPolicyUnknownConfiguration. 4075func (ckpuc ContentKeyPolicyUnknownConfiguration) MarshalJSON() ([]byte, error) { 4076 ckpuc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration 4077 objectMap := make(map[string]interface{}) 4078 if ckpuc.OdataType != "" { 4079 objectMap["@odata.type"] = ckpuc.OdataType 4080 } 4081 return json.Marshal(objectMap) 4082} 4083 4084// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration. 4085func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) { 4086 return nil, false 4087} 4088 4089// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration. 4090func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) { 4091 return &ckpuc, true 4092} 4093 4094// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration. 4095func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) { 4096 return nil, false 4097} 4098 4099// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration. 4100func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) { 4101 return nil, false 4102} 4103 4104// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration. 4105func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) { 4106 return nil, false 4107} 4108 4109// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration. 4110func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) { 4111 return nil, false 4112} 4113 4114// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration. 4115func (ckpuc ContentKeyPolicyUnknownConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) { 4116 return &ckpuc, true 4117} 4118 4119// ContentKeyPolicyUnknownRestriction represents a ContentKeyPolicyRestriction that is unavailable in the 4120// current API version. 4121type ContentKeyPolicyUnknownRestriction struct { 4122 // OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction' 4123 OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"` 4124} 4125 4126// MarshalJSON is the custom marshaler for ContentKeyPolicyUnknownRestriction. 4127func (ckpur ContentKeyPolicyUnknownRestriction) MarshalJSON() ([]byte, error) { 4128 ckpur.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction 4129 objectMap := make(map[string]interface{}) 4130 if ckpur.OdataType != "" { 4131 objectMap["@odata.type"] = ckpur.OdataType 4132 } 4133 return json.Marshal(objectMap) 4134} 4135 4136// AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction. 4137func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) { 4138 return nil, false 4139} 4140 4141// AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction. 4142func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) { 4143 return &ckpur, true 4144} 4145 4146// AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction. 4147func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) { 4148 return nil, false 4149} 4150 4151// AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction. 4152func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) { 4153 return nil, false 4154} 4155 4156// AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction. 4157func (ckpur ContentKeyPolicyUnknownRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) { 4158 return &ckpur, true 4159} 4160 4161// ContentKeyPolicyWidevineConfiguration specifies a configuration for Widevine licenses. 4162type ContentKeyPolicyWidevineConfiguration struct { 4163 // WidevineTemplate - The Widevine template. 4164 WidevineTemplate *string `json:"widevineTemplate,omitempty"` 4165 // OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration' 4166 OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"` 4167} 4168 4169// MarshalJSON is the custom marshaler for ContentKeyPolicyWidevineConfiguration. 4170func (ckpwc ContentKeyPolicyWidevineConfiguration) MarshalJSON() ([]byte, error) { 4171 ckpwc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration 4172 objectMap := make(map[string]interface{}) 4173 if ckpwc.WidevineTemplate != nil { 4174 objectMap["widevineTemplate"] = ckpwc.WidevineTemplate 4175 } 4176 if ckpwc.OdataType != "" { 4177 objectMap["@odata.type"] = ckpwc.OdataType 4178 } 4179 return json.Marshal(objectMap) 4180} 4181 4182// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration. 4183func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) { 4184 return nil, false 4185} 4186 4187// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration. 4188func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) { 4189 return nil, false 4190} 4191 4192// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration. 4193func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) { 4194 return &ckpwc, true 4195} 4196 4197// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration. 4198func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) { 4199 return nil, false 4200} 4201 4202// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration. 4203func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) { 4204 return nil, false 4205} 4206 4207// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration. 4208func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) { 4209 return nil, false 4210} 4211 4212// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration. 4213func (ckpwc ContentKeyPolicyWidevineConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) { 4214 return &ckpwc, true 4215} 4216 4217// ContentKeyPolicyX509CertificateTokenKey specifies a certificate for token validation. 4218type ContentKeyPolicyX509CertificateTokenKey struct { 4219 // RawBody - The raw data field of a certificate in PKCS 12 format (X509Certificate2 in .NET) 4220 RawBody *[]byte `json:"rawBody,omitempty"` 4221 // OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey' 4222 OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"` 4223} 4224 4225// MarshalJSON is the custom marshaler for ContentKeyPolicyX509CertificateTokenKey. 4226func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) MarshalJSON() ([]byte, error) { 4227 ckpxctk.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey 4228 objectMap := make(map[string]interface{}) 4229 if ckpxctk.RawBody != nil { 4230 objectMap["rawBody"] = ckpxctk.RawBody 4231 } 4232 if ckpxctk.OdataType != "" { 4233 objectMap["@odata.type"] = ckpxctk.OdataType 4234 } 4235 return json.Marshal(objectMap) 4236} 4237 4238// AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey. 4239func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) { 4240 return nil, false 4241} 4242 4243// AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey. 4244func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) { 4245 return nil, false 4246} 4247 4248// AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey. 4249func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) { 4250 return &ckpxctk, true 4251} 4252 4253// AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey. 4254func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) { 4255 return nil, false 4256} 4257 4258// AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey. 4259func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) { 4260 return &ckpxctk, true 4261} 4262 4263// CopyAudio a codec flag, which tells the encoder to copy the input audio bitstream. 4264type CopyAudio struct { 4265 // Label - An optional label for the codec. The label can be used to control muxing behavior. 4266 Label *string `json:"label,omitempty"` 4267 // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' 4268 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` 4269} 4270 4271// MarshalJSON is the custom marshaler for CopyAudio. 4272func (ca CopyAudio) MarshalJSON() ([]byte, error) { 4273 ca.OdataType = OdataTypeMicrosoftMediaCopyAudio 4274 objectMap := make(map[string]interface{}) 4275 if ca.Label != nil { 4276 objectMap["label"] = ca.Label 4277 } 4278 if ca.OdataType != "" { 4279 objectMap["@odata.type"] = ca.OdataType 4280 } 4281 return json.Marshal(objectMap) 4282} 4283 4284// AsAudio is the BasicCodec implementation for CopyAudio. 4285func (ca CopyAudio) AsAudio() (*Audio, bool) { 4286 return nil, false 4287} 4288 4289// AsBasicAudio is the BasicCodec implementation for CopyAudio. 4290func (ca CopyAudio) AsBasicAudio() (BasicAudio, bool) { 4291 return nil, false 4292} 4293 4294// AsAacAudio is the BasicCodec implementation for CopyAudio. 4295func (ca CopyAudio) AsAacAudio() (*AacAudio, bool) { 4296 return nil, false 4297} 4298 4299// AsCopyVideo is the BasicCodec implementation for CopyAudio. 4300func (ca CopyAudio) AsCopyVideo() (*CopyVideo, bool) { 4301 return nil, false 4302} 4303 4304// AsVideo is the BasicCodec implementation for CopyAudio. 4305func (ca CopyAudio) AsVideo() (*Video, bool) { 4306 return nil, false 4307} 4308 4309// AsBasicVideo is the BasicCodec implementation for CopyAudio. 4310func (ca CopyAudio) AsBasicVideo() (BasicVideo, bool) { 4311 return nil, false 4312} 4313 4314// AsImage is the BasicCodec implementation for CopyAudio. 4315func (ca CopyAudio) AsImage() (*Image, bool) { 4316 return nil, false 4317} 4318 4319// AsBasicImage is the BasicCodec implementation for CopyAudio. 4320func (ca CopyAudio) AsBasicImage() (BasicImage, bool) { 4321 return nil, false 4322} 4323 4324// AsCopyAudio is the BasicCodec implementation for CopyAudio. 4325func (ca CopyAudio) AsCopyAudio() (*CopyAudio, bool) { 4326 return &ca, true 4327} 4328 4329// AsH264Video is the BasicCodec implementation for CopyAudio. 4330func (ca CopyAudio) AsH264Video() (*H264Video, bool) { 4331 return nil, false 4332} 4333 4334// AsJpgImage is the BasicCodec implementation for CopyAudio. 4335func (ca CopyAudio) AsJpgImage() (*JpgImage, bool) { 4336 return nil, false 4337} 4338 4339// AsPngImage is the BasicCodec implementation for CopyAudio. 4340func (ca CopyAudio) AsPngImage() (*PngImage, bool) { 4341 return nil, false 4342} 4343 4344// AsCodec is the BasicCodec implementation for CopyAudio. 4345func (ca CopyAudio) AsCodec() (*Codec, bool) { 4346 return nil, false 4347} 4348 4349// AsBasicCodec is the BasicCodec implementation for CopyAudio. 4350func (ca CopyAudio) AsBasicCodec() (BasicCodec, bool) { 4351 return &ca, true 4352} 4353 4354// CopyVideo a codec flag, which tells the encoder to copy the input video bitstream without re-encoding. 4355type CopyVideo struct { 4356 // Label - An optional label for the codec. The label can be used to control muxing behavior. 4357 Label *string `json:"label,omitempty"` 4358 // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' 4359 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` 4360} 4361 4362// MarshalJSON is the custom marshaler for CopyVideo. 4363func (cv CopyVideo) MarshalJSON() ([]byte, error) { 4364 cv.OdataType = OdataTypeMicrosoftMediaCopyVideo 4365 objectMap := make(map[string]interface{}) 4366 if cv.Label != nil { 4367 objectMap["label"] = cv.Label 4368 } 4369 if cv.OdataType != "" { 4370 objectMap["@odata.type"] = cv.OdataType 4371 } 4372 return json.Marshal(objectMap) 4373} 4374 4375// AsAudio is the BasicCodec implementation for CopyVideo. 4376func (cv CopyVideo) AsAudio() (*Audio, bool) { 4377 return nil, false 4378} 4379 4380// AsBasicAudio is the BasicCodec implementation for CopyVideo. 4381func (cv CopyVideo) AsBasicAudio() (BasicAudio, bool) { 4382 return nil, false 4383} 4384 4385// AsAacAudio is the BasicCodec implementation for CopyVideo. 4386func (cv CopyVideo) AsAacAudio() (*AacAudio, bool) { 4387 return nil, false 4388} 4389 4390// AsCopyVideo is the BasicCodec implementation for CopyVideo. 4391func (cv CopyVideo) AsCopyVideo() (*CopyVideo, bool) { 4392 return &cv, true 4393} 4394 4395// AsVideo is the BasicCodec implementation for CopyVideo. 4396func (cv CopyVideo) AsVideo() (*Video, bool) { 4397 return nil, false 4398} 4399 4400// AsBasicVideo is the BasicCodec implementation for CopyVideo. 4401func (cv CopyVideo) AsBasicVideo() (BasicVideo, bool) { 4402 return nil, false 4403} 4404 4405// AsImage is the BasicCodec implementation for CopyVideo. 4406func (cv CopyVideo) AsImage() (*Image, bool) { 4407 return nil, false 4408} 4409 4410// AsBasicImage is the BasicCodec implementation for CopyVideo. 4411func (cv CopyVideo) AsBasicImage() (BasicImage, bool) { 4412 return nil, false 4413} 4414 4415// AsCopyAudio is the BasicCodec implementation for CopyVideo. 4416func (cv CopyVideo) AsCopyAudio() (*CopyAudio, bool) { 4417 return nil, false 4418} 4419 4420// AsH264Video is the BasicCodec implementation for CopyVideo. 4421func (cv CopyVideo) AsH264Video() (*H264Video, bool) { 4422 return nil, false 4423} 4424 4425// AsJpgImage is the BasicCodec implementation for CopyVideo. 4426func (cv CopyVideo) AsJpgImage() (*JpgImage, bool) { 4427 return nil, false 4428} 4429 4430// AsPngImage is the BasicCodec implementation for CopyVideo. 4431func (cv CopyVideo) AsPngImage() (*PngImage, bool) { 4432 return nil, false 4433} 4434 4435// AsCodec is the BasicCodec implementation for CopyVideo. 4436func (cv CopyVideo) AsCodec() (*Codec, bool) { 4437 return nil, false 4438} 4439 4440// AsBasicCodec is the BasicCodec implementation for CopyVideo. 4441func (cv CopyVideo) AsBasicCodec() (BasicCodec, bool) { 4442 return &cv, true 4443} 4444 4445// CrossSiteAccessPolicies the client access policy. 4446type CrossSiteAccessPolicies struct { 4447 // ClientAccessPolicy - The content of clientaccesspolicy.xml used by Silverlight. 4448 ClientAccessPolicy *string `json:"clientAccessPolicy,omitempty"` 4449 // CrossDomainPolicy - The content of crossdomain.xml used by Silverlight. 4450 CrossDomainPolicy *string `json:"crossDomainPolicy,omitempty"` 4451} 4452 4453// DefaultKey class to specify properties of default content key for each encryption scheme 4454type DefaultKey struct { 4455 // Label - Label can be used to specify Content Key when creating a Streaming Locator 4456 Label *string `json:"label,omitempty"` 4457 // PolicyName - Policy used by Default Key 4458 PolicyName *string `json:"policyName,omitempty"` 4459} 4460 4461// Deinterlace describes the de-interlacing settings. 4462type Deinterlace struct { 4463 // Parity - The field parity for de-interlacing, defaults to Auto. Possible values include: 'Auto', 'TopFieldFirst', 'BottomFieldFirst' 4464 Parity DeinterlaceParity `json:"parity,omitempty"` 4465 // Mode - The deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values include: 'Off', 'AutoPixelAdaptive' 4466 Mode DeinterlaceMode `json:"mode,omitempty"` 4467} 4468 4469// EnabledProtocols class to specify which protocols are enabled 4470type EnabledProtocols struct { 4471 // Download - Enable Download protocol or not 4472 Download *bool `json:"download,omitempty"` 4473 // Dash - Enable DASH protocol or not 4474 Dash *bool `json:"dash,omitempty"` 4475 // Hls - Enable HLS protocol or not 4476 Hls *bool `json:"hls,omitempty"` 4477 // SmoothStreaming - Enable SmoothStreaming protocol or not 4478 SmoothStreaming *bool `json:"smoothStreaming,omitempty"` 4479} 4480 4481// EntityNameAvailabilityCheckOutput the response from the check name availability request. 4482type EntityNameAvailabilityCheckOutput struct { 4483 autorest.Response `json:"-"` 4484 // NameAvailable - Specifies if the name is available. 4485 NameAvailable *bool `json:"nameAvailable,omitempty"` 4486 // Reason - Specifies the reason if the name is not available. 4487 Reason *string `json:"reason,omitempty"` 4488 // Message - Specifies the detailed reason if the name is not available. 4489 Message *string `json:"message,omitempty"` 4490} 4491 4492// EnvelopeEncryption class for EnvelopeEncryption encryption scheme 4493type EnvelopeEncryption struct { 4494 // EnabledProtocols - Representing supported protocols 4495 EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"` 4496 // ClearTracks - Representing which tracks should not be encrypted 4497 ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"` 4498 // ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks 4499 ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"` 4500 // CustomKeyAcquisitionURLTemplate - Template for the URL of the custom service delivering keys to end user players. Not required when using Azure Media Services for issuing keys. The template supports replaceable tokens that the service will update at runtime with the value specific to the request. The currently supported token values are {AlternativeMediaId}, which is replaced with the value of StreamingLocatorId.AlternativeMediaId, and {ContentKeyId}, which is replaced with the value of identifier of the key being requested. 4501 CustomKeyAcquisitionURLTemplate *string `json:"customKeyAcquisitionUrlTemplate,omitempty"` 4502} 4503 4504// FaceDetectorPreset describes all the settings to be used when analyzing a video in order to detect all 4505// the faces present. 4506type FaceDetectorPreset struct { 4507 // Resolution - Specifies the maximum resolution at which your video is analyzed. The default behavior is "SourceResolution," which will keep the input video at its original resolution when analyzed. Using "StandardDefinition" will resize input videos to standard definition while preserving the appropriate aspect ratio. It will only resize if the video is of higher resolution. For example, a 1920x1080 input would be scaled to 640x360 before processing. Switching to "StandardDefinition" will reduce the time it takes to process high resolution video. It may also reduce the cost of using this component (see https://azure.microsoft.com/en-us/pricing/details/media-services/#analytics for details). However, faces that end up being too small in the resized video may not be detected. Possible values include: 'SourceResolution', 'StandardDefinition' 4508 Resolution AnalysisResolution `json:"resolution,omitempty"` 4509 // OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset' 4510 OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"` 4511} 4512 4513// MarshalJSON is the custom marshaler for FaceDetectorPreset. 4514func (fdp FaceDetectorPreset) MarshalJSON() ([]byte, error) { 4515 fdp.OdataType = OdataTypeMicrosoftMediaFaceDetectorPreset 4516 objectMap := make(map[string]interface{}) 4517 if fdp.Resolution != "" { 4518 objectMap["resolution"] = fdp.Resolution 4519 } 4520 if fdp.OdataType != "" { 4521 objectMap["@odata.type"] = fdp.OdataType 4522 } 4523 return json.Marshal(objectMap) 4524} 4525 4526// AsFaceDetectorPreset is the BasicPreset implementation for FaceDetectorPreset. 4527func (fdp FaceDetectorPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) { 4528 return &fdp, true 4529} 4530 4531// AsAudioAnalyzerPreset is the BasicPreset implementation for FaceDetectorPreset. 4532func (fdp FaceDetectorPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) { 4533 return nil, false 4534} 4535 4536// AsBasicAudioAnalyzerPreset is the BasicPreset implementation for FaceDetectorPreset. 4537func (fdp FaceDetectorPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) { 4538 return nil, false 4539} 4540 4541// AsBuiltInStandardEncoderPreset is the BasicPreset implementation for FaceDetectorPreset. 4542func (fdp FaceDetectorPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) { 4543 return nil, false 4544} 4545 4546// AsStandardEncoderPreset is the BasicPreset implementation for FaceDetectorPreset. 4547func (fdp FaceDetectorPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) { 4548 return nil, false 4549} 4550 4551// AsVideoAnalyzerPreset is the BasicPreset implementation for FaceDetectorPreset. 4552func (fdp FaceDetectorPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) { 4553 return nil, false 4554} 4555 4556// AsPreset is the BasicPreset implementation for FaceDetectorPreset. 4557func (fdp FaceDetectorPreset) AsPreset() (*Preset, bool) { 4558 return nil, false 4559} 4560 4561// AsBasicPreset is the BasicPreset implementation for FaceDetectorPreset. 4562func (fdp FaceDetectorPreset) AsBasicPreset() (BasicPreset, bool) { 4563 return &fdp, true 4564} 4565 4566// FilterProperties the Media Filter properties. 4567type FilterProperties struct { 4568 // PresentationTimeRange - The presentation time range. 4569 PresentationTimeRange *PresentationTimeRange `json:"presentationTimeRange,omitempty"` 4570 // FirstQuality - The first quality. 4571 FirstQuality *FirstQuality `json:"firstQuality,omitempty"` 4572 // Tracks - The tracks selection conditions. 4573 Tracks *[]FilterTrackSelection `json:"tracks,omitempty"` 4574} 4575 4576// Filters describes all the filtering operations, such as de-interlacing, rotation etc. that are to be 4577// applied to the input media before encoding. 4578type Filters struct { 4579 // Deinterlace - The de-interlacing settings. 4580 Deinterlace *Deinterlace `json:"deinterlace,omitempty"` 4581 // Rotation - The rotation, if any, to be applied to the input video, before it is encoded. Default is Auto. Possible values include: 'RotationAuto', 'RotationNone', 'RotationRotate0', 'RotationRotate90', 'RotationRotate180', 'RotationRotate270' 4582 Rotation Rotation `json:"rotation,omitempty"` 4583 // Crop - The parameters for the rectangular window with which to crop the input video. 4584 Crop *Rectangle `json:"crop,omitempty"` 4585 // Overlays - The properties of overlays to be applied to the input video. These could be audio, image or video overlays. 4586 Overlays *[]BasicOverlay `json:"overlays,omitempty"` 4587} 4588 4589// UnmarshalJSON is the custom unmarshaler for Filters struct. 4590func (f *Filters) UnmarshalJSON(body []byte) error { 4591 var m map[string]*json.RawMessage 4592 err := json.Unmarshal(body, &m) 4593 if err != nil { 4594 return err 4595 } 4596 for k, v := range m { 4597 switch k { 4598 case "deinterlace": 4599 if v != nil { 4600 var deinterlace Deinterlace 4601 err = json.Unmarshal(*v, &deinterlace) 4602 if err != nil { 4603 return err 4604 } 4605 f.Deinterlace = &deinterlace 4606 } 4607 case "rotation": 4608 if v != nil { 4609 var rotation Rotation 4610 err = json.Unmarshal(*v, &rotation) 4611 if err != nil { 4612 return err 4613 } 4614 f.Rotation = rotation 4615 } 4616 case "crop": 4617 if v != nil { 4618 var crop Rectangle 4619 err = json.Unmarshal(*v, &crop) 4620 if err != nil { 4621 return err 4622 } 4623 f.Crop = &crop 4624 } 4625 case "overlays": 4626 if v != nil { 4627 overlays, err := unmarshalBasicOverlayArray(*v) 4628 if err != nil { 4629 return err 4630 } 4631 f.Overlays = &overlays 4632 } 4633 } 4634 } 4635 4636 return nil 4637} 4638 4639// FilterTrackPropertyCondition the class to specify one track property condition. 4640type FilterTrackPropertyCondition struct { 4641 // Property - The track property type. Possible values include: 'FilterTrackPropertyTypeUnknown', 'FilterTrackPropertyTypeType', 'FilterTrackPropertyTypeName', 'FilterTrackPropertyTypeLanguage', 'FilterTrackPropertyTypeFourCC', 'FilterTrackPropertyTypeBitrate' 4642 Property FilterTrackPropertyType `json:"property,omitempty"` 4643 // Value - The track property value. 4644 Value *string `json:"value,omitempty"` 4645 // Operation - The track property condition operation. Possible values include: 'Equal', 'NotEqual' 4646 Operation FilterTrackPropertyCompareOperation `json:"operation,omitempty"` 4647} 4648 4649// FilterTrackSelection representing a list of FilterTrackPropertyConditions to select a track. The 4650// filters are combined using a logical AND operation. 4651type FilterTrackSelection struct { 4652 // TrackSelections - The track selections. 4653 TrackSelections *[]FilterTrackPropertyCondition `json:"trackSelections,omitempty"` 4654} 4655 4656// FirstQuality filter First Quality 4657type FirstQuality struct { 4658 // Bitrate - The first quality bitrate. 4659 Bitrate *int32 `json:"bitrate,omitempty"` 4660} 4661 4662// BasicFormat base class for output. 4663type BasicFormat interface { 4664 AsImageFormat() (*ImageFormat, bool) 4665 AsBasicImageFormat() (BasicImageFormat, bool) 4666 AsJpgFormat() (*JpgFormat, bool) 4667 AsPngFormat() (*PngFormat, bool) 4668 AsMultiBitrateFormat() (*MultiBitrateFormat, bool) 4669 AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) 4670 AsMp4Format() (*Mp4Format, bool) 4671 AsTransportStreamFormat() (*TransportStreamFormat, bool) 4672 AsFormat() (*Format, bool) 4673} 4674 4675// Format base class for output. 4676type Format struct { 4677 // FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. 4678 FilenamePattern *string `json:"filenamePattern,omitempty"` 4679 // OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat' 4680 OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"` 4681} 4682 4683func unmarshalBasicFormat(body []byte) (BasicFormat, error) { 4684 var m map[string]interface{} 4685 err := json.Unmarshal(body, &m) 4686 if err != nil { 4687 return nil, err 4688 } 4689 4690 switch m["@odata.type"] { 4691 case string(OdataTypeMicrosoftMediaImageFormat): 4692 var ifVar ImageFormat 4693 err := json.Unmarshal(body, &ifVar) 4694 return ifVar, err 4695 case string(OdataTypeMicrosoftMediaJpgFormat): 4696 var jf JpgFormat 4697 err := json.Unmarshal(body, &jf) 4698 return jf, err 4699 case string(OdataTypeMicrosoftMediaPngFormat): 4700 var pf PngFormat 4701 err := json.Unmarshal(body, &pf) 4702 return pf, err 4703 case string(OdataTypeMicrosoftMediaMultiBitrateFormat): 4704 var mbf MultiBitrateFormat 4705 err := json.Unmarshal(body, &mbf) 4706 return mbf, err 4707 case string(OdataTypeMicrosoftMediaMp4Format): 4708 var m4f Mp4Format 4709 err := json.Unmarshal(body, &m4f) 4710 return m4f, err 4711 case string(OdataTypeMicrosoftMediaTransportStreamFormat): 4712 var tsf TransportStreamFormat 4713 err := json.Unmarshal(body, &tsf) 4714 return tsf, err 4715 default: 4716 var f Format 4717 err := json.Unmarshal(body, &f) 4718 return f, err 4719 } 4720} 4721func unmarshalBasicFormatArray(body []byte) ([]BasicFormat, error) { 4722 var rawMessages []*json.RawMessage 4723 err := json.Unmarshal(body, &rawMessages) 4724 if err != nil { 4725 return nil, err 4726 } 4727 4728 fArray := make([]BasicFormat, len(rawMessages)) 4729 4730 for index, rawMessage := range rawMessages { 4731 f, err := unmarshalBasicFormat(*rawMessage) 4732 if err != nil { 4733 return nil, err 4734 } 4735 fArray[index] = f 4736 } 4737 return fArray, nil 4738} 4739 4740// MarshalJSON is the custom marshaler for Format. 4741func (f Format) MarshalJSON() ([]byte, error) { 4742 f.OdataType = OdataTypeFormat 4743 objectMap := make(map[string]interface{}) 4744 if f.FilenamePattern != nil { 4745 objectMap["filenamePattern"] = f.FilenamePattern 4746 } 4747 if f.OdataType != "" { 4748 objectMap["@odata.type"] = f.OdataType 4749 } 4750 return json.Marshal(objectMap) 4751} 4752 4753// AsImageFormat is the BasicFormat implementation for Format. 4754func (f Format) AsImageFormat() (*ImageFormat, bool) { 4755 return nil, false 4756} 4757 4758// AsBasicImageFormat is the BasicFormat implementation for Format. 4759func (f Format) AsBasicImageFormat() (BasicImageFormat, bool) { 4760 return nil, false 4761} 4762 4763// AsJpgFormat is the BasicFormat implementation for Format. 4764func (f Format) AsJpgFormat() (*JpgFormat, bool) { 4765 return nil, false 4766} 4767 4768// AsPngFormat is the BasicFormat implementation for Format. 4769func (f Format) AsPngFormat() (*PngFormat, bool) { 4770 return nil, false 4771} 4772 4773// AsMultiBitrateFormat is the BasicFormat implementation for Format. 4774func (f Format) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) { 4775 return nil, false 4776} 4777 4778// AsBasicMultiBitrateFormat is the BasicFormat implementation for Format. 4779func (f Format) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) { 4780 return nil, false 4781} 4782 4783// AsMp4Format is the BasicFormat implementation for Format. 4784func (f Format) AsMp4Format() (*Mp4Format, bool) { 4785 return nil, false 4786} 4787 4788// AsTransportStreamFormat is the BasicFormat implementation for Format. 4789func (f Format) AsTransportStreamFormat() (*TransportStreamFormat, bool) { 4790 return nil, false 4791} 4792 4793// AsFormat is the BasicFormat implementation for Format. 4794func (f Format) AsFormat() (*Format, bool) { 4795 return &f, true 4796} 4797 4798// AsBasicFormat is the BasicFormat implementation for Format. 4799func (f Format) AsBasicFormat() (BasicFormat, bool) { 4800 return &f, true 4801} 4802 4803// H264Layer describes the settings to be used when encoding the input video into a desired output bitrate 4804// layer with the H.264 video codec. 4805type H264Layer struct { 4806 // Profile - We currently support Baseline, Main, High, High422, High444. Default is Auto. Possible values include: 'H264VideoProfileAuto', 'H264VideoProfileBaseline', 'H264VideoProfileMain', 'H264VideoProfileHigh', 'H264VideoProfileHigh422', 'H264VideoProfileHigh444' 4807 Profile H264VideoProfile `json:"profile,omitempty"` 4808 // Level - We currently support Level up to 6.2. The value can be Auto, or a number that matches the H.264 profile. If not specified, the default is Auto, which lets the encoder choose the Level that is appropriate for this layer. 4809 Level *string `json:"level,omitempty"` 4810 // BufferWindow - The VBV buffer window length. The value should be in ISO 8601 format. The value should be in the range [0.1-100] seconds. The default is 5 seconds (for example, PT5S). 4811 BufferWindow *string `json:"bufferWindow,omitempty"` 4812 // ReferenceFrames - The number of reference frames to be used when encoding this layer. If not specified, the encoder determines an appropriate number based on the encoder complexity setting. 4813 ReferenceFrames *int32 `json:"referenceFrames,omitempty"` 4814 // EntropyMode - The entropy mode to be used for this layer. If not specified, the encoder chooses the mode that is appropriate for the profile and level. Possible values include: 'Cabac', 'Cavlc' 4815 EntropyMode EntropyMode `json:"entropyMode,omitempty"` 4816 // Bitrate - The average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field. 4817 Bitrate *int32 `json:"bitrate,omitempty"` 4818 // MaxBitrate - The maximum bitrate (in bits per second), at which the VBV buffer should be assumed to refill. If not specified, defaults to the same value as bitrate. 4819 MaxBitrate *int32 `json:"maxBitrate,omitempty"` 4820 // BFrames - The number of B-frames to be used when encoding this layer. If not specified, the encoder chooses an appropriate number based on the video profile and level. 4821 BFrames *int32 `json:"bFrames,omitempty"` 4822 // FrameRate - The frame rate (in frames per second) at which to encode this layer. The value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame rates based on the profile and level. If it is not specified, the encoder will use the same frame rate as the input video. 4823 FrameRate *string `json:"frameRate,omitempty"` 4824 // Slices - The number of slices to be used when encoding this layer. If not specified, default is zero, which means that encoder will use a single slice for each frame. 4825 Slices *int32 `json:"slices,omitempty"` 4826 // AdaptiveBFrame - Whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use. 4827 AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"` 4828 // Width - The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. 4829 Width *string `json:"width,omitempty"` 4830 // Height - The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. 4831 Height *string `json:"height,omitempty"` 4832 // Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file. 4833 Label *string `json:"label,omitempty"` 4834 // OdataType - Possible values include: 'OdataTypeLayer', 'OdataTypeMicrosoftMediaVideoLayer', 'OdataTypeMicrosoftMediaH264Layer', 'OdataTypeMicrosoftMediaJpgLayer', 'OdataTypeMicrosoftMediaPngLayer' 4835 OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"` 4836} 4837 4838// MarshalJSON is the custom marshaler for H264Layer. 4839func (hl H264Layer) MarshalJSON() ([]byte, error) { 4840 hl.OdataType = OdataTypeMicrosoftMediaH264Layer 4841 objectMap := make(map[string]interface{}) 4842 if hl.Profile != "" { 4843 objectMap["profile"] = hl.Profile 4844 } 4845 if hl.Level != nil { 4846 objectMap["level"] = hl.Level 4847 } 4848 if hl.BufferWindow != nil { 4849 objectMap["bufferWindow"] = hl.BufferWindow 4850 } 4851 if hl.ReferenceFrames != nil { 4852 objectMap["referenceFrames"] = hl.ReferenceFrames 4853 } 4854 if hl.EntropyMode != "" { 4855 objectMap["entropyMode"] = hl.EntropyMode 4856 } 4857 if hl.Bitrate != nil { 4858 objectMap["bitrate"] = hl.Bitrate 4859 } 4860 if hl.MaxBitrate != nil { 4861 objectMap["maxBitrate"] = hl.MaxBitrate 4862 } 4863 if hl.BFrames != nil { 4864 objectMap["bFrames"] = hl.BFrames 4865 } 4866 if hl.FrameRate != nil { 4867 objectMap["frameRate"] = hl.FrameRate 4868 } 4869 if hl.Slices != nil { 4870 objectMap["slices"] = hl.Slices 4871 } 4872 if hl.AdaptiveBFrame != nil { 4873 objectMap["adaptiveBFrame"] = hl.AdaptiveBFrame 4874 } 4875 if hl.Width != nil { 4876 objectMap["width"] = hl.Width 4877 } 4878 if hl.Height != nil { 4879 objectMap["height"] = hl.Height 4880 } 4881 if hl.Label != nil { 4882 objectMap["label"] = hl.Label 4883 } 4884 if hl.OdataType != "" { 4885 objectMap["@odata.type"] = hl.OdataType 4886 } 4887 return json.Marshal(objectMap) 4888} 4889 4890// AsVideoLayer is the BasicLayer implementation for H264Layer. 4891func (hl H264Layer) AsVideoLayer() (*VideoLayer, bool) { 4892 return nil, false 4893} 4894 4895// AsBasicVideoLayer is the BasicLayer implementation for H264Layer. 4896func (hl H264Layer) AsBasicVideoLayer() (BasicVideoLayer, bool) { 4897 return &hl, true 4898} 4899 4900// AsH264Layer is the BasicLayer implementation for H264Layer. 4901func (hl H264Layer) AsH264Layer() (*H264Layer, bool) { 4902 return &hl, true 4903} 4904 4905// AsJpgLayer is the BasicLayer implementation for H264Layer. 4906func (hl H264Layer) AsJpgLayer() (*JpgLayer, bool) { 4907 return nil, false 4908} 4909 4910// AsPngLayer is the BasicLayer implementation for H264Layer. 4911func (hl H264Layer) AsPngLayer() (*PngLayer, bool) { 4912 return nil, false 4913} 4914 4915// AsLayer is the BasicLayer implementation for H264Layer. 4916func (hl H264Layer) AsLayer() (*Layer, bool) { 4917 return nil, false 4918} 4919 4920// AsBasicLayer is the BasicLayer implementation for H264Layer. 4921func (hl H264Layer) AsBasicLayer() (BasicLayer, bool) { 4922 return &hl, true 4923} 4924 4925// H264Video describes all the properties for encoding a video with the H.264 codec. 4926type H264Video struct { 4927 // SceneChangeDetection - Whether or not the encoder should insert key frames at scene changes. If not specified, the default is false. This flag should be set to true only when the encoder is being configured to produce a single output video. 4928 SceneChangeDetection *bool `json:"sceneChangeDetection,omitempty"` 4929 // Complexity - Tells the encoder how to choose its encoding settings. The default value is Balanced. Possible values include: 'Speed', 'Balanced', 'Quality' 4930 Complexity H264Complexity `json:"complexity,omitempty"` 4931 // Layers - The collection of output H.264 layers to be produced by the encoder. 4932 Layers *[]H264Layer `json:"layers,omitempty"` 4933 // KeyFrameInterval - The distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). 4934 KeyFrameInterval *string `json:"keyFrameInterval,omitempty"` 4935 // StretchMode - The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit' 4936 StretchMode StretchMode `json:"stretchMode,omitempty"` 4937 // Label - An optional label for the codec. The label can be used to control muxing behavior. 4938 Label *string `json:"label,omitempty"` 4939 // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' 4940 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` 4941} 4942 4943// MarshalJSON is the custom marshaler for H264Video. 4944func (hv H264Video) MarshalJSON() ([]byte, error) { 4945 hv.OdataType = OdataTypeMicrosoftMediaH264Video 4946 objectMap := make(map[string]interface{}) 4947 if hv.SceneChangeDetection != nil { 4948 objectMap["sceneChangeDetection"] = hv.SceneChangeDetection 4949 } 4950 if hv.Complexity != "" { 4951 objectMap["complexity"] = hv.Complexity 4952 } 4953 if hv.Layers != nil { 4954 objectMap["layers"] = hv.Layers 4955 } 4956 if hv.KeyFrameInterval != nil { 4957 objectMap["keyFrameInterval"] = hv.KeyFrameInterval 4958 } 4959 if hv.StretchMode != "" { 4960 objectMap["stretchMode"] = hv.StretchMode 4961 } 4962 if hv.Label != nil { 4963 objectMap["label"] = hv.Label 4964 } 4965 if hv.OdataType != "" { 4966 objectMap["@odata.type"] = hv.OdataType 4967 } 4968 return json.Marshal(objectMap) 4969} 4970 4971// AsAudio is the BasicCodec implementation for H264Video. 4972func (hv H264Video) AsAudio() (*Audio, bool) { 4973 return nil, false 4974} 4975 4976// AsBasicAudio is the BasicCodec implementation for H264Video. 4977func (hv H264Video) AsBasicAudio() (BasicAudio, bool) { 4978 return nil, false 4979} 4980 4981// AsAacAudio is the BasicCodec implementation for H264Video. 4982func (hv H264Video) AsAacAudio() (*AacAudio, bool) { 4983 return nil, false 4984} 4985 4986// AsCopyVideo is the BasicCodec implementation for H264Video. 4987func (hv H264Video) AsCopyVideo() (*CopyVideo, bool) { 4988 return nil, false 4989} 4990 4991// AsVideo is the BasicCodec implementation for H264Video. 4992func (hv H264Video) AsVideo() (*Video, bool) { 4993 return nil, false 4994} 4995 4996// AsBasicVideo is the BasicCodec implementation for H264Video. 4997func (hv H264Video) AsBasicVideo() (BasicVideo, bool) { 4998 return &hv, true 4999} 5000 5001// AsImage is the BasicCodec implementation for H264Video. 5002func (hv H264Video) AsImage() (*Image, bool) { 5003 return nil, false 5004} 5005 5006// AsBasicImage is the BasicCodec implementation for H264Video. 5007func (hv H264Video) AsBasicImage() (BasicImage, bool) { 5008 return nil, false 5009} 5010 5011// AsCopyAudio is the BasicCodec implementation for H264Video. 5012func (hv H264Video) AsCopyAudio() (*CopyAudio, bool) { 5013 return nil, false 5014} 5015 5016// AsH264Video is the BasicCodec implementation for H264Video. 5017func (hv H264Video) AsH264Video() (*H264Video, bool) { 5018 return &hv, true 5019} 5020 5021// AsJpgImage is the BasicCodec implementation for H264Video. 5022func (hv H264Video) AsJpgImage() (*JpgImage, bool) { 5023 return nil, false 5024} 5025 5026// AsPngImage is the BasicCodec implementation for H264Video. 5027func (hv H264Video) AsPngImage() (*PngImage, bool) { 5028 return nil, false 5029} 5030 5031// AsCodec is the BasicCodec implementation for H264Video. 5032func (hv H264Video) AsCodec() (*Codec, bool) { 5033 return nil, false 5034} 5035 5036// AsBasicCodec is the BasicCodec implementation for H264Video. 5037func (hv H264Video) AsBasicCodec() (BasicCodec, bool) { 5038 return &hv, true 5039} 5040 5041// Hls the HLS configuration. 5042type Hls struct { 5043 // FragmentsPerTsSegment - The amount of fragments per HTTP Live Streaming (HLS) segment. 5044 FragmentsPerTsSegment *int32 `json:"fragmentsPerTsSegment,omitempty"` 5045} 5046 5047// BasicImage describes the basic properties for generating thumbnails from the input video 5048type BasicImage interface { 5049 AsJpgImage() (*JpgImage, bool) 5050 AsPngImage() (*PngImage, bool) 5051 AsImage() (*Image, bool) 5052} 5053 5054// Image describes the basic properties for generating thumbnails from the input video 5055type Image struct { 5056 // Start - The position in the input video from where to start generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT05S), or a frame count (For example, 10 for the 10th frame), or a relative value (For example, 1%). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video. 5057 Start *string `json:"start,omitempty"` 5058 // Step - The intervals at which thumbnails are generated. The value can be in absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), or a frame count (For example, 30 for every 30 frames), or a relative value (For example, 1%). 5059 Step *string `json:"step,omitempty"` 5060 // Range - The position in the input video at which to stop generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop at the 300th frame), or a relative value (For example, 100%). 5061 Range *string `json:"range,omitempty"` 5062 // KeyFrameInterval - The distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). 5063 KeyFrameInterval *string `json:"keyFrameInterval,omitempty"` 5064 // StretchMode - The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit' 5065 StretchMode StretchMode `json:"stretchMode,omitempty"` 5066 // Label - An optional label for the codec. The label can be used to control muxing behavior. 5067 Label *string `json:"label,omitempty"` 5068 // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' 5069 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` 5070} 5071 5072func unmarshalBasicImage(body []byte) (BasicImage, error) { 5073 var m map[string]interface{} 5074 err := json.Unmarshal(body, &m) 5075 if err != nil { 5076 return nil, err 5077 } 5078 5079 switch m["@odata.type"] { 5080 case string(OdataTypeMicrosoftMediaJpgImage): 5081 var ji JpgImage 5082 err := json.Unmarshal(body, &ji) 5083 return ji, err 5084 case string(OdataTypeMicrosoftMediaPngImage): 5085 var pi PngImage 5086 err := json.Unmarshal(body, &pi) 5087 return pi, err 5088 default: 5089 var i Image 5090 err := json.Unmarshal(body, &i) 5091 return i, err 5092 } 5093} 5094func unmarshalBasicImageArray(body []byte) ([]BasicImage, error) { 5095 var rawMessages []*json.RawMessage 5096 err := json.Unmarshal(body, &rawMessages) 5097 if err != nil { 5098 return nil, err 5099 } 5100 5101 iArray := make([]BasicImage, len(rawMessages)) 5102 5103 for index, rawMessage := range rawMessages { 5104 i, err := unmarshalBasicImage(*rawMessage) 5105 if err != nil { 5106 return nil, err 5107 } 5108 iArray[index] = i 5109 } 5110 return iArray, nil 5111} 5112 5113// MarshalJSON is the custom marshaler for Image. 5114func (i Image) MarshalJSON() ([]byte, error) { 5115 i.OdataType = OdataTypeMicrosoftMediaImage 5116 objectMap := make(map[string]interface{}) 5117 if i.Start != nil { 5118 objectMap["start"] = i.Start 5119 } 5120 if i.Step != nil { 5121 objectMap["step"] = i.Step 5122 } 5123 if i.Range != nil { 5124 objectMap["range"] = i.Range 5125 } 5126 if i.KeyFrameInterval != nil { 5127 objectMap["keyFrameInterval"] = i.KeyFrameInterval 5128 } 5129 if i.StretchMode != "" { 5130 objectMap["stretchMode"] = i.StretchMode 5131 } 5132 if i.Label != nil { 5133 objectMap["label"] = i.Label 5134 } 5135 if i.OdataType != "" { 5136 objectMap["@odata.type"] = i.OdataType 5137 } 5138 return json.Marshal(objectMap) 5139} 5140 5141// AsAudio is the BasicCodec implementation for Image. 5142func (i Image) AsAudio() (*Audio, bool) { 5143 return nil, false 5144} 5145 5146// AsBasicAudio is the BasicCodec implementation for Image. 5147func (i Image) AsBasicAudio() (BasicAudio, bool) { 5148 return nil, false 5149} 5150 5151// AsAacAudio is the BasicCodec implementation for Image. 5152func (i Image) AsAacAudio() (*AacAudio, bool) { 5153 return nil, false 5154} 5155 5156// AsCopyVideo is the BasicCodec implementation for Image. 5157func (i Image) AsCopyVideo() (*CopyVideo, bool) { 5158 return nil, false 5159} 5160 5161// AsVideo is the BasicCodec implementation for Image. 5162func (i Image) AsVideo() (*Video, bool) { 5163 return nil, false 5164} 5165 5166// AsBasicVideo is the BasicCodec implementation for Image. 5167func (i Image) AsBasicVideo() (BasicVideo, bool) { 5168 return &i, true 5169} 5170 5171// AsImage is the BasicCodec implementation for Image. 5172func (i Image) AsImage() (*Image, bool) { 5173 return &i, true 5174} 5175 5176// AsBasicImage is the BasicCodec implementation for Image. 5177func (i Image) AsBasicImage() (BasicImage, bool) { 5178 return &i, true 5179} 5180 5181// AsCopyAudio is the BasicCodec implementation for Image. 5182func (i Image) AsCopyAudio() (*CopyAudio, bool) { 5183 return nil, false 5184} 5185 5186// AsH264Video is the BasicCodec implementation for Image. 5187func (i Image) AsH264Video() (*H264Video, bool) { 5188 return nil, false 5189} 5190 5191// AsJpgImage is the BasicCodec implementation for Image. 5192func (i Image) AsJpgImage() (*JpgImage, bool) { 5193 return nil, false 5194} 5195 5196// AsPngImage is the BasicCodec implementation for Image. 5197func (i Image) AsPngImage() (*PngImage, bool) { 5198 return nil, false 5199} 5200 5201// AsCodec is the BasicCodec implementation for Image. 5202func (i Image) AsCodec() (*Codec, bool) { 5203 return nil, false 5204} 5205 5206// AsBasicCodec is the BasicCodec implementation for Image. 5207func (i Image) AsBasicCodec() (BasicCodec, bool) { 5208 return &i, true 5209} 5210 5211// BasicImageFormat describes the properties for an output image file. 5212type BasicImageFormat interface { 5213 AsJpgFormat() (*JpgFormat, bool) 5214 AsPngFormat() (*PngFormat, bool) 5215 AsImageFormat() (*ImageFormat, bool) 5216} 5217 5218// ImageFormat describes the properties for an output image file. 5219type ImageFormat struct { 5220 // FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. 5221 FilenamePattern *string `json:"filenamePattern,omitempty"` 5222 // OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat' 5223 OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"` 5224} 5225 5226func unmarshalBasicImageFormat(body []byte) (BasicImageFormat, error) { 5227 var m map[string]interface{} 5228 err := json.Unmarshal(body, &m) 5229 if err != nil { 5230 return nil, err 5231 } 5232 5233 switch m["@odata.type"] { 5234 case string(OdataTypeMicrosoftMediaJpgFormat): 5235 var jf JpgFormat 5236 err := json.Unmarshal(body, &jf) 5237 return jf, err 5238 case string(OdataTypeMicrosoftMediaPngFormat): 5239 var pf PngFormat 5240 err := json.Unmarshal(body, &pf) 5241 return pf, err 5242 default: 5243 var ifVar ImageFormat 5244 err := json.Unmarshal(body, &ifVar) 5245 return ifVar, err 5246 } 5247} 5248func unmarshalBasicImageFormatArray(body []byte) ([]BasicImageFormat, error) { 5249 var rawMessages []*json.RawMessage 5250 err := json.Unmarshal(body, &rawMessages) 5251 if err != nil { 5252 return nil, err 5253 } 5254 5255 ifVarArray := make([]BasicImageFormat, len(rawMessages)) 5256 5257 for index, rawMessage := range rawMessages { 5258 ifVar, err := unmarshalBasicImageFormat(*rawMessage) 5259 if err != nil { 5260 return nil, err 5261 } 5262 ifVarArray[index] = ifVar 5263 } 5264 return ifVarArray, nil 5265} 5266 5267// MarshalJSON is the custom marshaler for ImageFormat. 5268func (ifVar ImageFormat) MarshalJSON() ([]byte, error) { 5269 ifVar.OdataType = OdataTypeMicrosoftMediaImageFormat 5270 objectMap := make(map[string]interface{}) 5271 if ifVar.FilenamePattern != nil { 5272 objectMap["filenamePattern"] = ifVar.FilenamePattern 5273 } 5274 if ifVar.OdataType != "" { 5275 objectMap["@odata.type"] = ifVar.OdataType 5276 } 5277 return json.Marshal(objectMap) 5278} 5279 5280// AsImageFormat is the BasicFormat implementation for ImageFormat. 5281func (ifVar ImageFormat) AsImageFormat() (*ImageFormat, bool) { 5282 return &ifVar, true 5283} 5284 5285// AsBasicImageFormat is the BasicFormat implementation for ImageFormat. 5286func (ifVar ImageFormat) AsBasicImageFormat() (BasicImageFormat, bool) { 5287 return &ifVar, true 5288} 5289 5290// AsJpgFormat is the BasicFormat implementation for ImageFormat. 5291func (ifVar ImageFormat) AsJpgFormat() (*JpgFormat, bool) { 5292 return nil, false 5293} 5294 5295// AsPngFormat is the BasicFormat implementation for ImageFormat. 5296func (ifVar ImageFormat) AsPngFormat() (*PngFormat, bool) { 5297 return nil, false 5298} 5299 5300// AsMultiBitrateFormat is the BasicFormat implementation for ImageFormat. 5301func (ifVar ImageFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) { 5302 return nil, false 5303} 5304 5305// AsBasicMultiBitrateFormat is the BasicFormat implementation for ImageFormat. 5306func (ifVar ImageFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) { 5307 return nil, false 5308} 5309 5310// AsMp4Format is the BasicFormat implementation for ImageFormat. 5311func (ifVar ImageFormat) AsMp4Format() (*Mp4Format, bool) { 5312 return nil, false 5313} 5314 5315// AsTransportStreamFormat is the BasicFormat implementation for ImageFormat. 5316func (ifVar ImageFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) { 5317 return nil, false 5318} 5319 5320// AsFormat is the BasicFormat implementation for ImageFormat. 5321func (ifVar ImageFormat) AsFormat() (*Format, bool) { 5322 return nil, false 5323} 5324 5325// AsBasicFormat is the BasicFormat implementation for ImageFormat. 5326func (ifVar ImageFormat) AsBasicFormat() (BasicFormat, bool) { 5327 return &ifVar, true 5328} 5329 5330// IPAccessControl the IP access control. 5331type IPAccessControl struct { 5332 // Allow - The IP allow list. 5333 Allow *[]IPRange `json:"allow,omitempty"` 5334} 5335 5336// IPRange the IP address range in the CIDR scheme. 5337type IPRange struct { 5338 // Name - The friendly name for the IP address range. 5339 Name *string `json:"name,omitempty"` 5340 // Address - The IP address. 5341 Address *string `json:"address,omitempty"` 5342 // SubnetPrefixLength - The subnet mask prefix length (see CIDR notation). 5343 SubnetPrefixLength *int32 `json:"subnetPrefixLength,omitempty"` 5344} 5345 5346// Job a Job resource type. The progress and state can be obtained by polling a Job or subscribing to 5347// events using EventGrid. 5348type Job struct { 5349 autorest.Response `json:"-"` 5350 // JobProperties - The resource properties. 5351 *JobProperties `json:"properties,omitempty"` 5352 // ID - READ-ONLY; Fully qualified resource ID for the resource. 5353 ID *string `json:"id,omitempty"` 5354 // Name - READ-ONLY; The name of the resource. 5355 Name *string `json:"name,omitempty"` 5356 // Type - READ-ONLY; The type of the resource. 5357 Type *string `json:"type,omitempty"` 5358} 5359 5360// MarshalJSON is the custom marshaler for Job. 5361func (j Job) MarshalJSON() ([]byte, error) { 5362 objectMap := make(map[string]interface{}) 5363 if j.JobProperties != nil { 5364 objectMap["properties"] = j.JobProperties 5365 } 5366 return json.Marshal(objectMap) 5367} 5368 5369// UnmarshalJSON is the custom unmarshaler for Job struct. 5370func (j *Job) UnmarshalJSON(body []byte) error { 5371 var m map[string]*json.RawMessage 5372 err := json.Unmarshal(body, &m) 5373 if err != nil { 5374 return err 5375 } 5376 for k, v := range m { 5377 switch k { 5378 case "properties": 5379 if v != nil { 5380 var jobProperties JobProperties 5381 err = json.Unmarshal(*v, &jobProperties) 5382 if err != nil { 5383 return err 5384 } 5385 j.JobProperties = &jobProperties 5386 } 5387 case "id": 5388 if v != nil { 5389 var ID string 5390 err = json.Unmarshal(*v, &ID) 5391 if err != nil { 5392 return err 5393 } 5394 j.ID = &ID 5395 } 5396 case "name": 5397 if v != nil { 5398 var name string 5399 err = json.Unmarshal(*v, &name) 5400 if err != nil { 5401 return err 5402 } 5403 j.Name = &name 5404 } 5405 case "type": 5406 if v != nil { 5407 var typeVar string 5408 err = json.Unmarshal(*v, &typeVar) 5409 if err != nil { 5410 return err 5411 } 5412 j.Type = &typeVar 5413 } 5414 } 5415 } 5416 5417 return nil 5418} 5419 5420// JobCollection a collection of Job items. 5421type JobCollection struct { 5422 autorest.Response `json:"-"` 5423 // Value - A collection of Job items. 5424 Value *[]Job `json:"value,omitempty"` 5425 // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). 5426 OdataNextLink *string `json:"@odata.nextLink,omitempty"` 5427} 5428 5429// JobCollectionIterator provides access to a complete listing of Job values. 5430type JobCollectionIterator struct { 5431 i int 5432 page JobCollectionPage 5433} 5434 5435// NextWithContext advances to the next value. If there was an error making 5436// the request the iterator does not advance and the error is returned. 5437func (iter *JobCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5438 if tracing.IsEnabled() { 5439 ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionIterator.NextWithContext") 5440 defer func() { 5441 sc := -1 5442 if iter.Response().Response.Response != nil { 5443 sc = iter.Response().Response.Response.StatusCode 5444 } 5445 tracing.EndSpan(ctx, sc, err) 5446 }() 5447 } 5448 iter.i++ 5449 if iter.i < len(iter.page.Values()) { 5450 return nil 5451 } 5452 err = iter.page.NextWithContext(ctx) 5453 if err != nil { 5454 iter.i-- 5455 return err 5456 } 5457 iter.i = 0 5458 return nil 5459} 5460 5461// Next advances to the next value. If there was an error making 5462// the request the iterator does not advance and the error is returned. 5463// Deprecated: Use NextWithContext() instead. 5464func (iter *JobCollectionIterator) Next() error { 5465 return iter.NextWithContext(context.Background()) 5466} 5467 5468// NotDone returns true if the enumeration should be started or is not yet complete. 5469func (iter JobCollectionIterator) NotDone() bool { 5470 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5471} 5472 5473// Response returns the raw server response from the last page request. 5474func (iter JobCollectionIterator) Response() JobCollection { 5475 return iter.page.Response() 5476} 5477 5478// Value returns the current value or a zero-initialized value if the 5479// iterator has advanced beyond the end of the collection. 5480func (iter JobCollectionIterator) Value() Job { 5481 if !iter.page.NotDone() { 5482 return Job{} 5483 } 5484 return iter.page.Values()[iter.i] 5485} 5486 5487// Creates a new instance of the JobCollectionIterator type. 5488func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator { 5489 return JobCollectionIterator{page: page} 5490} 5491 5492// IsEmpty returns true if the ListResult contains no values. 5493func (jc JobCollection) IsEmpty() bool { 5494 return jc.Value == nil || len(*jc.Value) == 0 5495} 5496 5497// jobCollectionPreparer prepares a request to retrieve the next set of results. 5498// It returns nil if no more results exist. 5499func (jc JobCollection) jobCollectionPreparer(ctx context.Context) (*http.Request, error) { 5500 if jc.OdataNextLink == nil || len(to.String(jc.OdataNextLink)) < 1 { 5501 return nil, nil 5502 } 5503 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5504 autorest.AsJSON(), 5505 autorest.AsGet(), 5506 autorest.WithBaseURL(to.String(jc.OdataNextLink))) 5507} 5508 5509// JobCollectionPage contains a page of Job values. 5510type JobCollectionPage struct { 5511 fn func(context.Context, JobCollection) (JobCollection, error) 5512 jc JobCollection 5513} 5514 5515// NextWithContext advances to the next page of values. If there was an error making 5516// the request the page does not advance and the error is returned. 5517func (page *JobCollectionPage) NextWithContext(ctx context.Context) (err error) { 5518 if tracing.IsEnabled() { 5519 ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionPage.NextWithContext") 5520 defer func() { 5521 sc := -1 5522 if page.Response().Response.Response != nil { 5523 sc = page.Response().Response.Response.StatusCode 5524 } 5525 tracing.EndSpan(ctx, sc, err) 5526 }() 5527 } 5528 next, err := page.fn(ctx, page.jc) 5529 if err != nil { 5530 return err 5531 } 5532 page.jc = next 5533 return nil 5534} 5535 5536// Next advances to the next page of values. If there was an error making 5537// the request the page does not advance and the error is returned. 5538// Deprecated: Use NextWithContext() instead. 5539func (page *JobCollectionPage) Next() error { 5540 return page.NextWithContext(context.Background()) 5541} 5542 5543// NotDone returns true if the page enumeration should be started or is not yet complete. 5544func (page JobCollectionPage) NotDone() bool { 5545 return !page.jc.IsEmpty() 5546} 5547 5548// Response returns the raw server response from the last page request. 5549func (page JobCollectionPage) Response() JobCollection { 5550 return page.jc 5551} 5552 5553// Values returns the slice of values for the current page or nil if there are no values. 5554func (page JobCollectionPage) Values() []Job { 5555 if page.jc.IsEmpty() { 5556 return nil 5557 } 5558 return *page.jc.Value 5559} 5560 5561// Creates a new instance of the JobCollectionPage type. 5562func NewJobCollectionPage(getNextPage func(context.Context, JobCollection) (JobCollection, error)) JobCollectionPage { 5563 return JobCollectionPage{fn: getNextPage} 5564} 5565 5566// JobError details of JobOutput errors. 5567type JobError struct { 5568 // Code - READ-ONLY; Error code describing the error. Possible values include: 'ServiceError', 'ServiceTransientError', 'DownloadNotAccessible', 'DownloadTransientError', 'UploadNotAccessible', 'UploadTransientError', 'ConfigurationUnsupported', 'ContentMalformed', 'ContentUnsupported' 5569 Code JobErrorCode `json:"code,omitempty"` 5570 // Message - READ-ONLY; A human-readable language-dependent representation of the error. 5571 Message *string `json:"message,omitempty"` 5572 // Category - READ-ONLY; Helps with categorization of errors. Possible values include: 'JobErrorCategoryService', 'JobErrorCategoryDownload', 'JobErrorCategoryUpload', 'JobErrorCategoryConfiguration', 'JobErrorCategoryContent' 5573 Category JobErrorCategory `json:"category,omitempty"` 5574 // Retry - READ-ONLY; Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. Possible values include: 'DoNotRetry', 'MayRetry' 5575 Retry JobRetry `json:"retry,omitempty"` 5576 // Details - READ-ONLY; An array of details about specific errors that led to this reported error. 5577 Details *[]JobErrorDetail `json:"details,omitempty"` 5578} 5579 5580// JobErrorDetail details of JobOutput errors. 5581type JobErrorDetail struct { 5582 // Code - READ-ONLY; Code describing the error detail. 5583 Code *string `json:"code,omitempty"` 5584 // Message - READ-ONLY; A human-readable representation of the error. 5585 Message *string `json:"message,omitempty"` 5586} 5587 5588// BasicJobInput base class for inputs to a Job. 5589type BasicJobInput interface { 5590 AsJobInputClip() (*JobInputClip, bool) 5591 AsBasicJobInputClip() (BasicJobInputClip, bool) 5592 AsJobInputs() (*JobInputs, bool) 5593 AsJobInputAsset() (*JobInputAsset, bool) 5594 AsJobInputHTTP() (*JobInputHTTP, bool) 5595 AsJobInput() (*JobInput, bool) 5596} 5597 5598// JobInput base class for inputs to a Job. 5599type JobInput struct { 5600 // OdataType - Possible values include: 'OdataTypeJobInput', 'OdataTypeMicrosoftMediaJobInputClip', 'OdataTypeMicrosoftMediaJobInputs', 'OdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeMicrosoftMediaJobInputHTTP' 5601 OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"` 5602} 5603 5604func unmarshalBasicJobInput(body []byte) (BasicJobInput, error) { 5605 var m map[string]interface{} 5606 err := json.Unmarshal(body, &m) 5607 if err != nil { 5608 return nil, err 5609 } 5610 5611 switch m["@odata.type"] { 5612 case string(OdataTypeMicrosoftMediaJobInputClip): 5613 var jic JobInputClip 5614 err := json.Unmarshal(body, &jic) 5615 return jic, err 5616 case string(OdataTypeMicrosoftMediaJobInputs): 5617 var ji JobInputs 5618 err := json.Unmarshal(body, &ji) 5619 return ji, err 5620 case string(OdataTypeMicrosoftMediaJobInputAsset): 5621 var jia JobInputAsset 5622 err := json.Unmarshal(body, &jia) 5623 return jia, err 5624 case string(OdataTypeMicrosoftMediaJobInputHTTP): 5625 var jih JobInputHTTP 5626 err := json.Unmarshal(body, &jih) 5627 return jih, err 5628 default: 5629 var ji JobInput 5630 err := json.Unmarshal(body, &ji) 5631 return ji, err 5632 } 5633} 5634func unmarshalBasicJobInputArray(body []byte) ([]BasicJobInput, error) { 5635 var rawMessages []*json.RawMessage 5636 err := json.Unmarshal(body, &rawMessages) 5637 if err != nil { 5638 return nil, err 5639 } 5640 5641 jiArray := make([]BasicJobInput, len(rawMessages)) 5642 5643 for index, rawMessage := range rawMessages { 5644 ji, err := unmarshalBasicJobInput(*rawMessage) 5645 if err != nil { 5646 return nil, err 5647 } 5648 jiArray[index] = ji 5649 } 5650 return jiArray, nil 5651} 5652 5653// MarshalJSON is the custom marshaler for JobInput. 5654func (ji JobInput) MarshalJSON() ([]byte, error) { 5655 ji.OdataType = OdataTypeJobInput 5656 objectMap := make(map[string]interface{}) 5657 if ji.OdataType != "" { 5658 objectMap["@odata.type"] = ji.OdataType 5659 } 5660 return json.Marshal(objectMap) 5661} 5662 5663// AsJobInputClip is the BasicJobInput implementation for JobInput. 5664func (ji JobInput) AsJobInputClip() (*JobInputClip, bool) { 5665 return nil, false 5666} 5667 5668// AsBasicJobInputClip is the BasicJobInput implementation for JobInput. 5669func (ji JobInput) AsBasicJobInputClip() (BasicJobInputClip, bool) { 5670 return nil, false 5671} 5672 5673// AsJobInputs is the BasicJobInput implementation for JobInput. 5674func (ji JobInput) AsJobInputs() (*JobInputs, bool) { 5675 return nil, false 5676} 5677 5678// AsJobInputAsset is the BasicJobInput implementation for JobInput. 5679func (ji JobInput) AsJobInputAsset() (*JobInputAsset, bool) { 5680 return nil, false 5681} 5682 5683// AsJobInputHTTP is the BasicJobInput implementation for JobInput. 5684func (ji JobInput) AsJobInputHTTP() (*JobInputHTTP, bool) { 5685 return nil, false 5686} 5687 5688// AsJobInput is the BasicJobInput implementation for JobInput. 5689func (ji JobInput) AsJobInput() (*JobInput, bool) { 5690 return &ji, true 5691} 5692 5693// AsBasicJobInput is the BasicJobInput implementation for JobInput. 5694func (ji JobInput) AsBasicJobInput() (BasicJobInput, bool) { 5695 return &ji, true 5696} 5697 5698// JobInputAsset represents an Asset for input into a Job. 5699type JobInputAsset struct { 5700 // AssetName - The name of the input Asset. 5701 AssetName *string `json:"assetName,omitempty"` 5702 // Files - List of files. Required for JobInputHttp. Maximum of 4000 characters each. 5703 Files *[]string `json:"files,omitempty"` 5704 // Start - Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media. 5705 Start BasicClipTime `json:"start,omitempty"` 5706 // End - Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media. 5707 End BasicClipTime `json:"end,omitempty"` 5708 // Label - A label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'. 5709 Label *string `json:"label,omitempty"` 5710 // OdataType - Possible values include: 'OdataTypeJobInput', 'OdataTypeMicrosoftMediaJobInputClip', 'OdataTypeMicrosoftMediaJobInputs', 'OdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeMicrosoftMediaJobInputHTTP' 5711 OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"` 5712} 5713 5714// MarshalJSON is the custom marshaler for JobInputAsset. 5715func (jia JobInputAsset) MarshalJSON() ([]byte, error) { 5716 jia.OdataType = OdataTypeMicrosoftMediaJobInputAsset 5717 objectMap := make(map[string]interface{}) 5718 if jia.AssetName != nil { 5719 objectMap["assetName"] = jia.AssetName 5720 } 5721 if jia.Files != nil { 5722 objectMap["files"] = jia.Files 5723 } 5724 objectMap["start"] = jia.Start 5725 objectMap["end"] = jia.End 5726 if jia.Label != nil { 5727 objectMap["label"] = jia.Label 5728 } 5729 if jia.OdataType != "" { 5730 objectMap["@odata.type"] = jia.OdataType 5731 } 5732 return json.Marshal(objectMap) 5733} 5734 5735// AsJobInputClip is the BasicJobInput implementation for JobInputAsset. 5736func (jia JobInputAsset) AsJobInputClip() (*JobInputClip, bool) { 5737 return nil, false 5738} 5739 5740// AsBasicJobInputClip is the BasicJobInput implementation for JobInputAsset. 5741func (jia JobInputAsset) AsBasicJobInputClip() (BasicJobInputClip, bool) { 5742 return &jia, true 5743} 5744 5745// AsJobInputs is the BasicJobInput implementation for JobInputAsset. 5746func (jia JobInputAsset) AsJobInputs() (*JobInputs, bool) { 5747 return nil, false 5748} 5749 5750// AsJobInputAsset is the BasicJobInput implementation for JobInputAsset. 5751func (jia JobInputAsset) AsJobInputAsset() (*JobInputAsset, bool) { 5752 return &jia, true 5753} 5754 5755// AsJobInputHTTP is the BasicJobInput implementation for JobInputAsset. 5756func (jia JobInputAsset) AsJobInputHTTP() (*JobInputHTTP, bool) { 5757 return nil, false 5758} 5759 5760// AsJobInput is the BasicJobInput implementation for JobInputAsset. 5761func (jia JobInputAsset) AsJobInput() (*JobInput, bool) { 5762 return nil, false 5763} 5764 5765// AsBasicJobInput is the BasicJobInput implementation for JobInputAsset. 5766func (jia JobInputAsset) AsBasicJobInput() (BasicJobInput, bool) { 5767 return &jia, true 5768} 5769 5770// UnmarshalJSON is the custom unmarshaler for JobInputAsset struct. 5771func (jia *JobInputAsset) UnmarshalJSON(body []byte) error { 5772 var m map[string]*json.RawMessage 5773 err := json.Unmarshal(body, &m) 5774 if err != nil { 5775 return err 5776 } 5777 for k, v := range m { 5778 switch k { 5779 case "assetName": 5780 if v != nil { 5781 var assetName string 5782 err = json.Unmarshal(*v, &assetName) 5783 if err != nil { 5784 return err 5785 } 5786 jia.AssetName = &assetName 5787 } 5788 case "files": 5789 if v != nil { 5790 var files []string 5791 err = json.Unmarshal(*v, &files) 5792 if err != nil { 5793 return err 5794 } 5795 jia.Files = &files 5796 } 5797 case "start": 5798 if v != nil { 5799 start, err := unmarshalBasicClipTime(*v) 5800 if err != nil { 5801 return err 5802 } 5803 jia.Start = start 5804 } 5805 case "end": 5806 if v != nil { 5807 end, err := unmarshalBasicClipTime(*v) 5808 if err != nil { 5809 return err 5810 } 5811 jia.End = end 5812 } 5813 case "label": 5814 if v != nil { 5815 var label string 5816 err = json.Unmarshal(*v, &label) 5817 if err != nil { 5818 return err 5819 } 5820 jia.Label = &label 5821 } 5822 case "@odata.type": 5823 if v != nil { 5824 var odataType OdataTypeBasicJobInput 5825 err = json.Unmarshal(*v, &odataType) 5826 if err != nil { 5827 return err 5828 } 5829 jia.OdataType = odataType 5830 } 5831 } 5832 } 5833 5834 return nil 5835} 5836 5837// BasicJobInputClip represents input files for a Job. 5838type BasicJobInputClip interface { 5839 AsJobInputAsset() (*JobInputAsset, bool) 5840 AsJobInputHTTP() (*JobInputHTTP, bool) 5841 AsJobInputClip() (*JobInputClip, bool) 5842} 5843 5844// JobInputClip represents input files for a Job. 5845type JobInputClip struct { 5846 // Files - List of files. Required for JobInputHttp. Maximum of 4000 characters each. 5847 Files *[]string `json:"files,omitempty"` 5848 // Start - Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media. 5849 Start BasicClipTime `json:"start,omitempty"` 5850 // End - Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media. 5851 End BasicClipTime `json:"end,omitempty"` 5852 // Label - A label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'. 5853 Label *string `json:"label,omitempty"` 5854 // OdataType - Possible values include: 'OdataTypeJobInput', 'OdataTypeMicrosoftMediaJobInputClip', 'OdataTypeMicrosoftMediaJobInputs', 'OdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeMicrosoftMediaJobInputHTTP' 5855 OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"` 5856} 5857 5858func unmarshalBasicJobInputClip(body []byte) (BasicJobInputClip, error) { 5859 var m map[string]interface{} 5860 err := json.Unmarshal(body, &m) 5861 if err != nil { 5862 return nil, err 5863 } 5864 5865 switch m["@odata.type"] { 5866 case string(OdataTypeMicrosoftMediaJobInputAsset): 5867 var jia JobInputAsset 5868 err := json.Unmarshal(body, &jia) 5869 return jia, err 5870 case string(OdataTypeMicrosoftMediaJobInputHTTP): 5871 var jih JobInputHTTP 5872 err := json.Unmarshal(body, &jih) 5873 return jih, err 5874 default: 5875 var jic JobInputClip 5876 err := json.Unmarshal(body, &jic) 5877 return jic, err 5878 } 5879} 5880func unmarshalBasicJobInputClipArray(body []byte) ([]BasicJobInputClip, error) { 5881 var rawMessages []*json.RawMessage 5882 err := json.Unmarshal(body, &rawMessages) 5883 if err != nil { 5884 return nil, err 5885 } 5886 5887 jicArray := make([]BasicJobInputClip, len(rawMessages)) 5888 5889 for index, rawMessage := range rawMessages { 5890 jic, err := unmarshalBasicJobInputClip(*rawMessage) 5891 if err != nil { 5892 return nil, err 5893 } 5894 jicArray[index] = jic 5895 } 5896 return jicArray, nil 5897} 5898 5899// MarshalJSON is the custom marshaler for JobInputClip. 5900func (jic JobInputClip) MarshalJSON() ([]byte, error) { 5901 jic.OdataType = OdataTypeMicrosoftMediaJobInputClip 5902 objectMap := make(map[string]interface{}) 5903 if jic.Files != nil { 5904 objectMap["files"] = jic.Files 5905 } 5906 objectMap["start"] = jic.Start 5907 objectMap["end"] = jic.End 5908 if jic.Label != nil { 5909 objectMap["label"] = jic.Label 5910 } 5911 if jic.OdataType != "" { 5912 objectMap["@odata.type"] = jic.OdataType 5913 } 5914 return json.Marshal(objectMap) 5915} 5916 5917// AsJobInputClip is the BasicJobInput implementation for JobInputClip. 5918func (jic JobInputClip) AsJobInputClip() (*JobInputClip, bool) { 5919 return &jic, true 5920} 5921 5922// AsBasicJobInputClip is the BasicJobInput implementation for JobInputClip. 5923func (jic JobInputClip) AsBasicJobInputClip() (BasicJobInputClip, bool) { 5924 return &jic, true 5925} 5926 5927// AsJobInputs is the BasicJobInput implementation for JobInputClip. 5928func (jic JobInputClip) AsJobInputs() (*JobInputs, bool) { 5929 return nil, false 5930} 5931 5932// AsJobInputAsset is the BasicJobInput implementation for JobInputClip. 5933func (jic JobInputClip) AsJobInputAsset() (*JobInputAsset, bool) { 5934 return nil, false 5935} 5936 5937// AsJobInputHTTP is the BasicJobInput implementation for JobInputClip. 5938func (jic JobInputClip) AsJobInputHTTP() (*JobInputHTTP, bool) { 5939 return nil, false 5940} 5941 5942// AsJobInput is the BasicJobInput implementation for JobInputClip. 5943func (jic JobInputClip) AsJobInput() (*JobInput, bool) { 5944 return nil, false 5945} 5946 5947// AsBasicJobInput is the BasicJobInput implementation for JobInputClip. 5948func (jic JobInputClip) AsBasicJobInput() (BasicJobInput, bool) { 5949 return &jic, true 5950} 5951 5952// UnmarshalJSON is the custom unmarshaler for JobInputClip struct. 5953func (jic *JobInputClip) UnmarshalJSON(body []byte) error { 5954 var m map[string]*json.RawMessage 5955 err := json.Unmarshal(body, &m) 5956 if err != nil { 5957 return err 5958 } 5959 for k, v := range m { 5960 switch k { 5961 case "files": 5962 if v != nil { 5963 var files []string 5964 err = json.Unmarshal(*v, &files) 5965 if err != nil { 5966 return err 5967 } 5968 jic.Files = &files 5969 } 5970 case "start": 5971 if v != nil { 5972 start, err := unmarshalBasicClipTime(*v) 5973 if err != nil { 5974 return err 5975 } 5976 jic.Start = start 5977 } 5978 case "end": 5979 if v != nil { 5980 end, err := unmarshalBasicClipTime(*v) 5981 if err != nil { 5982 return err 5983 } 5984 jic.End = end 5985 } 5986 case "label": 5987 if v != nil { 5988 var label string 5989 err = json.Unmarshal(*v, &label) 5990 if err != nil { 5991 return err 5992 } 5993 jic.Label = &label 5994 } 5995 case "@odata.type": 5996 if v != nil { 5997 var odataType OdataTypeBasicJobInput 5998 err = json.Unmarshal(*v, &odataType) 5999 if err != nil { 6000 return err 6001 } 6002 jic.OdataType = odataType 6003 } 6004 } 6005 } 6006 6007 return nil 6008} 6009 6010// JobInputHTTP represents HTTPS job input. 6011type JobInputHTTP struct { 6012 // BaseURI - Base URI for HTTPS job input. It will be concatenated with provided file names. If no base uri is given, then the provided file list is assumed to be fully qualified uris. Maximum length of 4000 characters. 6013 BaseURI *string `json:"baseUri,omitempty"` 6014 // Files - List of files. Required for JobInputHttp. Maximum of 4000 characters each. 6015 Files *[]string `json:"files,omitempty"` 6016 // Start - Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media. 6017 Start BasicClipTime `json:"start,omitempty"` 6018 // End - Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media. 6019 End BasicClipTime `json:"end,omitempty"` 6020 // Label - A label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'. 6021 Label *string `json:"label,omitempty"` 6022 // OdataType - Possible values include: 'OdataTypeJobInput', 'OdataTypeMicrosoftMediaJobInputClip', 'OdataTypeMicrosoftMediaJobInputs', 'OdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeMicrosoftMediaJobInputHTTP' 6023 OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"` 6024} 6025 6026// MarshalJSON is the custom marshaler for JobInputHTTP. 6027func (jih JobInputHTTP) MarshalJSON() ([]byte, error) { 6028 jih.OdataType = OdataTypeMicrosoftMediaJobInputHTTP 6029 objectMap := make(map[string]interface{}) 6030 if jih.BaseURI != nil { 6031 objectMap["baseUri"] = jih.BaseURI 6032 } 6033 if jih.Files != nil { 6034 objectMap["files"] = jih.Files 6035 } 6036 objectMap["start"] = jih.Start 6037 objectMap["end"] = jih.End 6038 if jih.Label != nil { 6039 objectMap["label"] = jih.Label 6040 } 6041 if jih.OdataType != "" { 6042 objectMap["@odata.type"] = jih.OdataType 6043 } 6044 return json.Marshal(objectMap) 6045} 6046 6047// AsJobInputClip is the BasicJobInput implementation for JobInputHTTP. 6048func (jih JobInputHTTP) AsJobInputClip() (*JobInputClip, bool) { 6049 return nil, false 6050} 6051 6052// AsBasicJobInputClip is the BasicJobInput implementation for JobInputHTTP. 6053func (jih JobInputHTTP) AsBasicJobInputClip() (BasicJobInputClip, bool) { 6054 return &jih, true 6055} 6056 6057// AsJobInputs is the BasicJobInput implementation for JobInputHTTP. 6058func (jih JobInputHTTP) AsJobInputs() (*JobInputs, bool) { 6059 return nil, false 6060} 6061 6062// AsJobInputAsset is the BasicJobInput implementation for JobInputHTTP. 6063func (jih JobInputHTTP) AsJobInputAsset() (*JobInputAsset, bool) { 6064 return nil, false 6065} 6066 6067// AsJobInputHTTP is the BasicJobInput implementation for JobInputHTTP. 6068func (jih JobInputHTTP) AsJobInputHTTP() (*JobInputHTTP, bool) { 6069 return &jih, true 6070} 6071 6072// AsJobInput is the BasicJobInput implementation for JobInputHTTP. 6073func (jih JobInputHTTP) AsJobInput() (*JobInput, bool) { 6074 return nil, false 6075} 6076 6077// AsBasicJobInput is the BasicJobInput implementation for JobInputHTTP. 6078func (jih JobInputHTTP) AsBasicJobInput() (BasicJobInput, bool) { 6079 return &jih, true 6080} 6081 6082// UnmarshalJSON is the custom unmarshaler for JobInputHTTP struct. 6083func (jih *JobInputHTTP) UnmarshalJSON(body []byte) error { 6084 var m map[string]*json.RawMessage 6085 err := json.Unmarshal(body, &m) 6086 if err != nil { 6087 return err 6088 } 6089 for k, v := range m { 6090 switch k { 6091 case "baseUri": 6092 if v != nil { 6093 var baseURI string 6094 err = json.Unmarshal(*v, &baseURI) 6095 if err != nil { 6096 return err 6097 } 6098 jih.BaseURI = &baseURI 6099 } 6100 case "files": 6101 if v != nil { 6102 var files []string 6103 err = json.Unmarshal(*v, &files) 6104 if err != nil { 6105 return err 6106 } 6107 jih.Files = &files 6108 } 6109 case "start": 6110 if v != nil { 6111 start, err := unmarshalBasicClipTime(*v) 6112 if err != nil { 6113 return err 6114 } 6115 jih.Start = start 6116 } 6117 case "end": 6118 if v != nil { 6119 end, err := unmarshalBasicClipTime(*v) 6120 if err != nil { 6121 return err 6122 } 6123 jih.End = end 6124 } 6125 case "label": 6126 if v != nil { 6127 var label string 6128 err = json.Unmarshal(*v, &label) 6129 if err != nil { 6130 return err 6131 } 6132 jih.Label = &label 6133 } 6134 case "@odata.type": 6135 if v != nil { 6136 var odataType OdataTypeBasicJobInput 6137 err = json.Unmarshal(*v, &odataType) 6138 if err != nil { 6139 return err 6140 } 6141 jih.OdataType = odataType 6142 } 6143 } 6144 } 6145 6146 return nil 6147} 6148 6149// JobInputs describes a list of inputs to a Job. 6150type JobInputs struct { 6151 // Inputs - List of inputs to a Job. 6152 Inputs *[]BasicJobInput `json:"inputs,omitempty"` 6153 // OdataType - Possible values include: 'OdataTypeJobInput', 'OdataTypeMicrosoftMediaJobInputClip', 'OdataTypeMicrosoftMediaJobInputs', 'OdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeMicrosoftMediaJobInputHTTP' 6154 OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"` 6155} 6156 6157// MarshalJSON is the custom marshaler for JobInputs. 6158func (ji JobInputs) MarshalJSON() ([]byte, error) { 6159 ji.OdataType = OdataTypeMicrosoftMediaJobInputs 6160 objectMap := make(map[string]interface{}) 6161 if ji.Inputs != nil { 6162 objectMap["inputs"] = ji.Inputs 6163 } 6164 if ji.OdataType != "" { 6165 objectMap["@odata.type"] = ji.OdataType 6166 } 6167 return json.Marshal(objectMap) 6168} 6169 6170// AsJobInputClip is the BasicJobInput implementation for JobInputs. 6171func (ji JobInputs) AsJobInputClip() (*JobInputClip, bool) { 6172 return nil, false 6173} 6174 6175// AsBasicJobInputClip is the BasicJobInput implementation for JobInputs. 6176func (ji JobInputs) AsBasicJobInputClip() (BasicJobInputClip, bool) { 6177 return nil, false 6178} 6179 6180// AsJobInputs is the BasicJobInput implementation for JobInputs. 6181func (ji JobInputs) AsJobInputs() (*JobInputs, bool) { 6182 return &ji, true 6183} 6184 6185// AsJobInputAsset is the BasicJobInput implementation for JobInputs. 6186func (ji JobInputs) AsJobInputAsset() (*JobInputAsset, bool) { 6187 return nil, false 6188} 6189 6190// AsJobInputHTTP is the BasicJobInput implementation for JobInputs. 6191func (ji JobInputs) AsJobInputHTTP() (*JobInputHTTP, bool) { 6192 return nil, false 6193} 6194 6195// AsJobInput is the BasicJobInput implementation for JobInputs. 6196func (ji JobInputs) AsJobInput() (*JobInput, bool) { 6197 return nil, false 6198} 6199 6200// AsBasicJobInput is the BasicJobInput implementation for JobInputs. 6201func (ji JobInputs) AsBasicJobInput() (BasicJobInput, bool) { 6202 return &ji, true 6203} 6204 6205// UnmarshalJSON is the custom unmarshaler for JobInputs struct. 6206func (ji *JobInputs) UnmarshalJSON(body []byte) error { 6207 var m map[string]*json.RawMessage 6208 err := json.Unmarshal(body, &m) 6209 if err != nil { 6210 return err 6211 } 6212 for k, v := range m { 6213 switch k { 6214 case "inputs": 6215 if v != nil { 6216 inputs, err := unmarshalBasicJobInputArray(*v) 6217 if err != nil { 6218 return err 6219 } 6220 ji.Inputs = &inputs 6221 } 6222 case "@odata.type": 6223 if v != nil { 6224 var odataType OdataTypeBasicJobInput 6225 err = json.Unmarshal(*v, &odataType) 6226 if err != nil { 6227 return err 6228 } 6229 ji.OdataType = odataType 6230 } 6231 } 6232 } 6233 6234 return nil 6235} 6236 6237// BasicJobOutput describes all the properties of a JobOutput. 6238type BasicJobOutput interface { 6239 AsJobOutputAsset() (*JobOutputAsset, bool) 6240 AsJobOutput() (*JobOutput, bool) 6241} 6242 6243// JobOutput describes all the properties of a JobOutput. 6244type JobOutput struct { 6245 // Error - READ-ONLY; If the JobOutput is in the Error state, it contains the details of the error. 6246 Error *JobError `json:"error,omitempty"` 6247 // State - READ-ONLY; Describes the state of the JobOutput. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled' 6248 State JobState `json:"state,omitempty"` 6249 // Progress - READ-ONLY; If the JobOutput is in a Processing state, this contains the Job completion percentage. The value is an estimate and not intended to be used to predict Job completion times. To determine if the JobOutput is complete, use the State property. 6250 Progress *int32 `json:"progress,omitempty"` 6251 // Label - A label that is assigned to a JobOutput in order to help uniquely identify it. This is useful when your Transform has more than one TransformOutput, whereby your Job has more than one JobOutput. In such cases, when you submit the Job, you will add two or more JobOutputs, in the same order as TransformOutputs in the Transform. Subsequently, when you retrieve the Job, either through events or on a GET request, you can use the label to easily identify the JobOutput. If a label is not provided, a default value of '{presetName}_{outputIndex}' will be used, where the preset name is the name of the preset in the corresponding TransformOutput and the output index is the relative index of the this JobOutput within the Job. Note that this index is the same as the relative index of the corresponding TransformOutput within its Transform. 6252 Label *string `json:"label,omitempty"` 6253 // OdataType - Possible values include: 'OdataTypeJobOutput', 'OdataTypeMicrosoftMediaJobOutputAsset' 6254 OdataType OdataTypeBasicJobOutput `json:"@odata.type,omitempty"` 6255} 6256 6257func unmarshalBasicJobOutput(body []byte) (BasicJobOutput, error) { 6258 var m map[string]interface{} 6259 err := json.Unmarshal(body, &m) 6260 if err != nil { 6261 return nil, err 6262 } 6263 6264 switch m["@odata.type"] { 6265 case string(OdataTypeMicrosoftMediaJobOutputAsset): 6266 var joa JobOutputAsset 6267 err := json.Unmarshal(body, &joa) 6268 return joa, err 6269 default: 6270 var jo JobOutput 6271 err := json.Unmarshal(body, &jo) 6272 return jo, err 6273 } 6274} 6275func unmarshalBasicJobOutputArray(body []byte) ([]BasicJobOutput, error) { 6276 var rawMessages []*json.RawMessage 6277 err := json.Unmarshal(body, &rawMessages) 6278 if err != nil { 6279 return nil, err 6280 } 6281 6282 joArray := make([]BasicJobOutput, len(rawMessages)) 6283 6284 for index, rawMessage := range rawMessages { 6285 jo, err := unmarshalBasicJobOutput(*rawMessage) 6286 if err != nil { 6287 return nil, err 6288 } 6289 joArray[index] = jo 6290 } 6291 return joArray, nil 6292} 6293 6294// MarshalJSON is the custom marshaler for JobOutput. 6295func (jo JobOutput) MarshalJSON() ([]byte, error) { 6296 jo.OdataType = OdataTypeJobOutput 6297 objectMap := make(map[string]interface{}) 6298 if jo.Label != nil { 6299 objectMap["label"] = jo.Label 6300 } 6301 if jo.OdataType != "" { 6302 objectMap["@odata.type"] = jo.OdataType 6303 } 6304 return json.Marshal(objectMap) 6305} 6306 6307// AsJobOutputAsset is the BasicJobOutput implementation for JobOutput. 6308func (jo JobOutput) AsJobOutputAsset() (*JobOutputAsset, bool) { 6309 return nil, false 6310} 6311 6312// AsJobOutput is the BasicJobOutput implementation for JobOutput. 6313func (jo JobOutput) AsJobOutput() (*JobOutput, bool) { 6314 return &jo, true 6315} 6316 6317// AsBasicJobOutput is the BasicJobOutput implementation for JobOutput. 6318func (jo JobOutput) AsBasicJobOutput() (BasicJobOutput, bool) { 6319 return &jo, true 6320} 6321 6322// JobOutputAsset represents an Asset used as a JobOutput. 6323type JobOutputAsset struct { 6324 // AssetName - The name of the output Asset. 6325 AssetName *string `json:"assetName,omitempty"` 6326 // Error - READ-ONLY; If the JobOutput is in the Error state, it contains the details of the error. 6327 Error *JobError `json:"error,omitempty"` 6328 // State - READ-ONLY; Describes the state of the JobOutput. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled' 6329 State JobState `json:"state,omitempty"` 6330 // Progress - READ-ONLY; If the JobOutput is in a Processing state, this contains the Job completion percentage. The value is an estimate and not intended to be used to predict Job completion times. To determine if the JobOutput is complete, use the State property. 6331 Progress *int32 `json:"progress,omitempty"` 6332 // Label - A label that is assigned to a JobOutput in order to help uniquely identify it. This is useful when your Transform has more than one TransformOutput, whereby your Job has more than one JobOutput. In such cases, when you submit the Job, you will add two or more JobOutputs, in the same order as TransformOutputs in the Transform. Subsequently, when you retrieve the Job, either through events or on a GET request, you can use the label to easily identify the JobOutput. If a label is not provided, a default value of '{presetName}_{outputIndex}' will be used, where the preset name is the name of the preset in the corresponding TransformOutput and the output index is the relative index of the this JobOutput within the Job. Note that this index is the same as the relative index of the corresponding TransformOutput within its Transform. 6333 Label *string `json:"label,omitempty"` 6334 // OdataType - Possible values include: 'OdataTypeJobOutput', 'OdataTypeMicrosoftMediaJobOutputAsset' 6335 OdataType OdataTypeBasicJobOutput `json:"@odata.type,omitempty"` 6336} 6337 6338// MarshalJSON is the custom marshaler for JobOutputAsset. 6339func (joa JobOutputAsset) MarshalJSON() ([]byte, error) { 6340 joa.OdataType = OdataTypeMicrosoftMediaJobOutputAsset 6341 objectMap := make(map[string]interface{}) 6342 if joa.AssetName != nil { 6343 objectMap["assetName"] = joa.AssetName 6344 } 6345 if joa.Label != nil { 6346 objectMap["label"] = joa.Label 6347 } 6348 if joa.OdataType != "" { 6349 objectMap["@odata.type"] = joa.OdataType 6350 } 6351 return json.Marshal(objectMap) 6352} 6353 6354// AsJobOutputAsset is the BasicJobOutput implementation for JobOutputAsset. 6355func (joa JobOutputAsset) AsJobOutputAsset() (*JobOutputAsset, bool) { 6356 return &joa, true 6357} 6358 6359// AsJobOutput is the BasicJobOutput implementation for JobOutputAsset. 6360func (joa JobOutputAsset) AsJobOutput() (*JobOutput, bool) { 6361 return nil, false 6362} 6363 6364// AsBasicJobOutput is the BasicJobOutput implementation for JobOutputAsset. 6365func (joa JobOutputAsset) AsBasicJobOutput() (BasicJobOutput, bool) { 6366 return &joa, true 6367} 6368 6369// JobProperties properties of the Job. 6370type JobProperties struct { 6371 // Created - READ-ONLY; The UTC date and time when the Job was created, in 'YYYY-MM-DDThh:mm:ssZ' format. 6372 Created *date.Time `json:"created,omitempty"` 6373 // State - READ-ONLY; The current state of the job. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled' 6374 State JobState `json:"state,omitempty"` 6375 // Description - Optional customer supplied description of the Job. 6376 Description *string `json:"description,omitempty"` 6377 // Input - The inputs for the Job. 6378 Input BasicJobInput `json:"input,omitempty"` 6379 // LastModified - READ-ONLY; The UTC date and time when the Job was last updated, in 'YYYY-MM-DDThh:mm:ssZ' format. 6380 LastModified *date.Time `json:"lastModified,omitempty"` 6381 // Outputs - The outputs for the Job. 6382 Outputs *[]BasicJobOutput `json:"outputs,omitempty"` 6383 // Priority - Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'Low', 'Normal', 'High' 6384 Priority Priority `json:"priority,omitempty"` 6385 // CorrelationData - Customer provided key, value pairs that will be returned in Job and JobOutput state events. 6386 CorrelationData map[string]*string `json:"correlationData"` 6387} 6388 6389// MarshalJSON is the custom marshaler for JobProperties. 6390func (jp JobProperties) MarshalJSON() ([]byte, error) { 6391 objectMap := make(map[string]interface{}) 6392 if jp.Description != nil { 6393 objectMap["description"] = jp.Description 6394 } 6395 objectMap["input"] = jp.Input 6396 if jp.Outputs != nil { 6397 objectMap["outputs"] = jp.Outputs 6398 } 6399 if jp.Priority != "" { 6400 objectMap["priority"] = jp.Priority 6401 } 6402 if jp.CorrelationData != nil { 6403 objectMap["correlationData"] = jp.CorrelationData 6404 } 6405 return json.Marshal(objectMap) 6406} 6407 6408// UnmarshalJSON is the custom unmarshaler for JobProperties struct. 6409func (jp *JobProperties) UnmarshalJSON(body []byte) error { 6410 var m map[string]*json.RawMessage 6411 err := json.Unmarshal(body, &m) 6412 if err != nil { 6413 return err 6414 } 6415 for k, v := range m { 6416 switch k { 6417 case "created": 6418 if v != nil { 6419 var created date.Time 6420 err = json.Unmarshal(*v, &created) 6421 if err != nil { 6422 return err 6423 } 6424 jp.Created = &created 6425 } 6426 case "state": 6427 if v != nil { 6428 var state JobState 6429 err = json.Unmarshal(*v, &state) 6430 if err != nil { 6431 return err 6432 } 6433 jp.State = state 6434 } 6435 case "description": 6436 if v != nil { 6437 var description string 6438 err = json.Unmarshal(*v, &description) 6439 if err != nil { 6440 return err 6441 } 6442 jp.Description = &description 6443 } 6444 case "input": 6445 if v != nil { 6446 input, err := unmarshalBasicJobInput(*v) 6447 if err != nil { 6448 return err 6449 } 6450 jp.Input = input 6451 } 6452 case "lastModified": 6453 if v != nil { 6454 var lastModified date.Time 6455 err = json.Unmarshal(*v, &lastModified) 6456 if err != nil { 6457 return err 6458 } 6459 jp.LastModified = &lastModified 6460 } 6461 case "outputs": 6462 if v != nil { 6463 outputs, err := unmarshalBasicJobOutputArray(*v) 6464 if err != nil { 6465 return err 6466 } 6467 jp.Outputs = &outputs 6468 } 6469 case "priority": 6470 if v != nil { 6471 var priority Priority 6472 err = json.Unmarshal(*v, &priority) 6473 if err != nil { 6474 return err 6475 } 6476 jp.Priority = priority 6477 } 6478 case "correlationData": 6479 if v != nil { 6480 var correlationData map[string]*string 6481 err = json.Unmarshal(*v, &correlationData) 6482 if err != nil { 6483 return err 6484 } 6485 jp.CorrelationData = correlationData 6486 } 6487 } 6488 } 6489 6490 return nil 6491} 6492 6493// JpgFormat describes the settings for producing JPEG thumbnails. 6494type JpgFormat struct { 6495 // FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. 6496 FilenamePattern *string `json:"filenamePattern,omitempty"` 6497 // OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat' 6498 OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"` 6499} 6500 6501// MarshalJSON is the custom marshaler for JpgFormat. 6502func (jf JpgFormat) MarshalJSON() ([]byte, error) { 6503 jf.OdataType = OdataTypeMicrosoftMediaJpgFormat 6504 objectMap := make(map[string]interface{}) 6505 if jf.FilenamePattern != nil { 6506 objectMap["filenamePattern"] = jf.FilenamePattern 6507 } 6508 if jf.OdataType != "" { 6509 objectMap["@odata.type"] = jf.OdataType 6510 } 6511 return json.Marshal(objectMap) 6512} 6513 6514// AsImageFormat is the BasicFormat implementation for JpgFormat. 6515func (jf JpgFormat) AsImageFormat() (*ImageFormat, bool) { 6516 return nil, false 6517} 6518 6519// AsBasicImageFormat is the BasicFormat implementation for JpgFormat. 6520func (jf JpgFormat) AsBasicImageFormat() (BasicImageFormat, bool) { 6521 return &jf, true 6522} 6523 6524// AsJpgFormat is the BasicFormat implementation for JpgFormat. 6525func (jf JpgFormat) AsJpgFormat() (*JpgFormat, bool) { 6526 return &jf, true 6527} 6528 6529// AsPngFormat is the BasicFormat implementation for JpgFormat. 6530func (jf JpgFormat) AsPngFormat() (*PngFormat, bool) { 6531 return nil, false 6532} 6533 6534// AsMultiBitrateFormat is the BasicFormat implementation for JpgFormat. 6535func (jf JpgFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) { 6536 return nil, false 6537} 6538 6539// AsBasicMultiBitrateFormat is the BasicFormat implementation for JpgFormat. 6540func (jf JpgFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) { 6541 return nil, false 6542} 6543 6544// AsMp4Format is the BasicFormat implementation for JpgFormat. 6545func (jf JpgFormat) AsMp4Format() (*Mp4Format, bool) { 6546 return nil, false 6547} 6548 6549// AsTransportStreamFormat is the BasicFormat implementation for JpgFormat. 6550func (jf JpgFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) { 6551 return nil, false 6552} 6553 6554// AsFormat is the BasicFormat implementation for JpgFormat. 6555func (jf JpgFormat) AsFormat() (*Format, bool) { 6556 return nil, false 6557} 6558 6559// AsBasicFormat is the BasicFormat implementation for JpgFormat. 6560func (jf JpgFormat) AsBasicFormat() (BasicFormat, bool) { 6561 return &jf, true 6562} 6563 6564// JpgImage describes the properties for producing a series of JPEG images from the input video. 6565type JpgImage struct { 6566 // Layers - A collection of output JPEG image layers to be produced by the encoder. 6567 Layers *[]JpgLayer `json:"layers,omitempty"` 6568 // Start - The position in the input video from where to start generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT05S), or a frame count (For example, 10 for the 10th frame), or a relative value (For example, 1%). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video. 6569 Start *string `json:"start,omitempty"` 6570 // Step - The intervals at which thumbnails are generated. The value can be in absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), or a frame count (For example, 30 for every 30 frames), or a relative value (For example, 1%). 6571 Step *string `json:"step,omitempty"` 6572 // Range - The position in the input video at which to stop generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop at the 300th frame), or a relative value (For example, 100%). 6573 Range *string `json:"range,omitempty"` 6574 // KeyFrameInterval - The distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). 6575 KeyFrameInterval *string `json:"keyFrameInterval,omitempty"` 6576 // StretchMode - The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit' 6577 StretchMode StretchMode `json:"stretchMode,omitempty"` 6578 // Label - An optional label for the codec. The label can be used to control muxing behavior. 6579 Label *string `json:"label,omitempty"` 6580 // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' 6581 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` 6582} 6583 6584// MarshalJSON is the custom marshaler for JpgImage. 6585func (ji JpgImage) MarshalJSON() ([]byte, error) { 6586 ji.OdataType = OdataTypeMicrosoftMediaJpgImage 6587 objectMap := make(map[string]interface{}) 6588 if ji.Layers != nil { 6589 objectMap["layers"] = ji.Layers 6590 } 6591 if ji.Start != nil { 6592 objectMap["start"] = ji.Start 6593 } 6594 if ji.Step != nil { 6595 objectMap["step"] = ji.Step 6596 } 6597 if ji.Range != nil { 6598 objectMap["range"] = ji.Range 6599 } 6600 if ji.KeyFrameInterval != nil { 6601 objectMap["keyFrameInterval"] = ji.KeyFrameInterval 6602 } 6603 if ji.StretchMode != "" { 6604 objectMap["stretchMode"] = ji.StretchMode 6605 } 6606 if ji.Label != nil { 6607 objectMap["label"] = ji.Label 6608 } 6609 if ji.OdataType != "" { 6610 objectMap["@odata.type"] = ji.OdataType 6611 } 6612 return json.Marshal(objectMap) 6613} 6614 6615// AsAudio is the BasicCodec implementation for JpgImage. 6616func (ji JpgImage) AsAudio() (*Audio, bool) { 6617 return nil, false 6618} 6619 6620// AsBasicAudio is the BasicCodec implementation for JpgImage. 6621func (ji JpgImage) AsBasicAudio() (BasicAudio, bool) { 6622 return nil, false 6623} 6624 6625// AsAacAudio is the BasicCodec implementation for JpgImage. 6626func (ji JpgImage) AsAacAudio() (*AacAudio, bool) { 6627 return nil, false 6628} 6629 6630// AsCopyVideo is the BasicCodec implementation for JpgImage. 6631func (ji JpgImage) AsCopyVideo() (*CopyVideo, bool) { 6632 return nil, false 6633} 6634 6635// AsVideo is the BasicCodec implementation for JpgImage. 6636func (ji JpgImage) AsVideo() (*Video, bool) { 6637 return nil, false 6638} 6639 6640// AsBasicVideo is the BasicCodec implementation for JpgImage. 6641func (ji JpgImage) AsBasicVideo() (BasicVideo, bool) { 6642 return &ji, true 6643} 6644 6645// AsImage is the BasicCodec implementation for JpgImage. 6646func (ji JpgImage) AsImage() (*Image, bool) { 6647 return nil, false 6648} 6649 6650// AsBasicImage is the BasicCodec implementation for JpgImage. 6651func (ji JpgImage) AsBasicImage() (BasicImage, bool) { 6652 return &ji, true 6653} 6654 6655// AsCopyAudio is the BasicCodec implementation for JpgImage. 6656func (ji JpgImage) AsCopyAudio() (*CopyAudio, bool) { 6657 return nil, false 6658} 6659 6660// AsH264Video is the BasicCodec implementation for JpgImage. 6661func (ji JpgImage) AsH264Video() (*H264Video, bool) { 6662 return nil, false 6663} 6664 6665// AsJpgImage is the BasicCodec implementation for JpgImage. 6666func (ji JpgImage) AsJpgImage() (*JpgImage, bool) { 6667 return &ji, true 6668} 6669 6670// AsPngImage is the BasicCodec implementation for JpgImage. 6671func (ji JpgImage) AsPngImage() (*PngImage, bool) { 6672 return nil, false 6673} 6674 6675// AsCodec is the BasicCodec implementation for JpgImage. 6676func (ji JpgImage) AsCodec() (*Codec, bool) { 6677 return nil, false 6678} 6679 6680// AsBasicCodec is the BasicCodec implementation for JpgImage. 6681func (ji JpgImage) AsBasicCodec() (BasicCodec, bool) { 6682 return &ji, true 6683} 6684 6685// JpgLayer describes the settings to produce a JPEG image from the input video. 6686type JpgLayer struct { 6687 // Quality - The compression quality of the JPEG output. Range is from 0-100 and the default is 70. 6688 Quality *int32 `json:"quality,omitempty"` 6689 // Width - The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. 6690 Width *string `json:"width,omitempty"` 6691 // Height - The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. 6692 Height *string `json:"height,omitempty"` 6693 // Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file. 6694 Label *string `json:"label,omitempty"` 6695 // OdataType - Possible values include: 'OdataTypeLayer', 'OdataTypeMicrosoftMediaVideoLayer', 'OdataTypeMicrosoftMediaH264Layer', 'OdataTypeMicrosoftMediaJpgLayer', 'OdataTypeMicrosoftMediaPngLayer' 6696 OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"` 6697} 6698 6699// MarshalJSON is the custom marshaler for JpgLayer. 6700func (jl JpgLayer) MarshalJSON() ([]byte, error) { 6701 jl.OdataType = OdataTypeMicrosoftMediaJpgLayer 6702 objectMap := make(map[string]interface{}) 6703 if jl.Quality != nil { 6704 objectMap["quality"] = jl.Quality 6705 } 6706 if jl.Width != nil { 6707 objectMap["width"] = jl.Width 6708 } 6709 if jl.Height != nil { 6710 objectMap["height"] = jl.Height 6711 } 6712 if jl.Label != nil { 6713 objectMap["label"] = jl.Label 6714 } 6715 if jl.OdataType != "" { 6716 objectMap["@odata.type"] = jl.OdataType 6717 } 6718 return json.Marshal(objectMap) 6719} 6720 6721// AsVideoLayer is the BasicLayer implementation for JpgLayer. 6722func (jl JpgLayer) AsVideoLayer() (*VideoLayer, bool) { 6723 return nil, false 6724} 6725 6726// AsBasicVideoLayer is the BasicLayer implementation for JpgLayer. 6727func (jl JpgLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) { 6728 return nil, false 6729} 6730 6731// AsH264Layer is the BasicLayer implementation for JpgLayer. 6732func (jl JpgLayer) AsH264Layer() (*H264Layer, bool) { 6733 return nil, false 6734} 6735 6736// AsJpgLayer is the BasicLayer implementation for JpgLayer. 6737func (jl JpgLayer) AsJpgLayer() (*JpgLayer, bool) { 6738 return &jl, true 6739} 6740 6741// AsPngLayer is the BasicLayer implementation for JpgLayer. 6742func (jl JpgLayer) AsPngLayer() (*PngLayer, bool) { 6743 return nil, false 6744} 6745 6746// AsLayer is the BasicLayer implementation for JpgLayer. 6747func (jl JpgLayer) AsLayer() (*Layer, bool) { 6748 return nil, false 6749} 6750 6751// AsBasicLayer is the BasicLayer implementation for JpgLayer. 6752func (jl JpgLayer) AsBasicLayer() (BasicLayer, bool) { 6753 return &jl, true 6754} 6755 6756// BasicLayer the encoder can be configured to produce video and/or images (thumbnails) at different resolutions, by 6757// specifying a layer for each desired resolution. A layer represents the properties for the video or image at a 6758// resolution. 6759type BasicLayer interface { 6760 AsVideoLayer() (*VideoLayer, bool) 6761 AsBasicVideoLayer() (BasicVideoLayer, bool) 6762 AsH264Layer() (*H264Layer, bool) 6763 AsJpgLayer() (*JpgLayer, bool) 6764 AsPngLayer() (*PngLayer, bool) 6765 AsLayer() (*Layer, bool) 6766} 6767 6768// Layer the encoder can be configured to produce video and/or images (thumbnails) at different resolutions, by 6769// specifying a layer for each desired resolution. A layer represents the properties for the video or image at 6770// a resolution. 6771type Layer struct { 6772 // Width - The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. 6773 Width *string `json:"width,omitempty"` 6774 // Height - The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. 6775 Height *string `json:"height,omitempty"` 6776 // Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file. 6777 Label *string `json:"label,omitempty"` 6778 // OdataType - Possible values include: 'OdataTypeLayer', 'OdataTypeMicrosoftMediaVideoLayer', 'OdataTypeMicrosoftMediaH264Layer', 'OdataTypeMicrosoftMediaJpgLayer', 'OdataTypeMicrosoftMediaPngLayer' 6779 OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"` 6780} 6781 6782func unmarshalBasicLayer(body []byte) (BasicLayer, error) { 6783 var m map[string]interface{} 6784 err := json.Unmarshal(body, &m) 6785 if err != nil { 6786 return nil, err 6787 } 6788 6789 switch m["@odata.type"] { 6790 case string(OdataTypeMicrosoftMediaVideoLayer): 6791 var vl VideoLayer 6792 err := json.Unmarshal(body, &vl) 6793 return vl, err 6794 case string(OdataTypeMicrosoftMediaH264Layer): 6795 var hl H264Layer 6796 err := json.Unmarshal(body, &hl) 6797 return hl, err 6798 case string(OdataTypeMicrosoftMediaJpgLayer): 6799 var jl JpgLayer 6800 err := json.Unmarshal(body, &jl) 6801 return jl, err 6802 case string(OdataTypeMicrosoftMediaPngLayer): 6803 var pl PngLayer 6804 err := json.Unmarshal(body, &pl) 6805 return pl, err 6806 default: 6807 var l Layer 6808 err := json.Unmarshal(body, &l) 6809 return l, err 6810 } 6811} 6812func unmarshalBasicLayerArray(body []byte) ([]BasicLayer, error) { 6813 var rawMessages []*json.RawMessage 6814 err := json.Unmarshal(body, &rawMessages) 6815 if err != nil { 6816 return nil, err 6817 } 6818 6819 lArray := make([]BasicLayer, len(rawMessages)) 6820 6821 for index, rawMessage := range rawMessages { 6822 l, err := unmarshalBasicLayer(*rawMessage) 6823 if err != nil { 6824 return nil, err 6825 } 6826 lArray[index] = l 6827 } 6828 return lArray, nil 6829} 6830 6831// MarshalJSON is the custom marshaler for Layer. 6832func (l Layer) MarshalJSON() ([]byte, error) { 6833 l.OdataType = OdataTypeLayer 6834 objectMap := make(map[string]interface{}) 6835 if l.Width != nil { 6836 objectMap["width"] = l.Width 6837 } 6838 if l.Height != nil { 6839 objectMap["height"] = l.Height 6840 } 6841 if l.Label != nil { 6842 objectMap["label"] = l.Label 6843 } 6844 if l.OdataType != "" { 6845 objectMap["@odata.type"] = l.OdataType 6846 } 6847 return json.Marshal(objectMap) 6848} 6849 6850// AsVideoLayer is the BasicLayer implementation for Layer. 6851func (l Layer) AsVideoLayer() (*VideoLayer, bool) { 6852 return nil, false 6853} 6854 6855// AsBasicVideoLayer is the BasicLayer implementation for Layer. 6856func (l Layer) AsBasicVideoLayer() (BasicVideoLayer, bool) { 6857 return nil, false 6858} 6859 6860// AsH264Layer is the BasicLayer implementation for Layer. 6861func (l Layer) AsH264Layer() (*H264Layer, bool) { 6862 return nil, false 6863} 6864 6865// AsJpgLayer is the BasicLayer implementation for Layer. 6866func (l Layer) AsJpgLayer() (*JpgLayer, bool) { 6867 return nil, false 6868} 6869 6870// AsPngLayer is the BasicLayer implementation for Layer. 6871func (l Layer) AsPngLayer() (*PngLayer, bool) { 6872 return nil, false 6873} 6874 6875// AsLayer is the BasicLayer implementation for Layer. 6876func (l Layer) AsLayer() (*Layer, bool) { 6877 return &l, true 6878} 6879 6880// AsBasicLayer is the BasicLayer implementation for Layer. 6881func (l Layer) AsBasicLayer() (BasicLayer, bool) { 6882 return &l, true 6883} 6884 6885// ListContainerSasInput the parameters to the list SAS request. 6886type ListContainerSasInput struct { 6887 // Permissions - The permissions to set on the SAS URL. Possible values include: 'Read', 'ReadWrite', 'ReadWriteDelete' 6888 Permissions AssetContainerPermission `json:"permissions,omitempty"` 6889 // ExpiryTime - The SAS URL expiration time. This must be less than 24 hours from the current time. 6890 ExpiryTime *date.Time `json:"expiryTime,omitempty"` 6891} 6892 6893// ListContentKeysResponse class of response for listContentKeys action 6894type ListContentKeysResponse struct { 6895 autorest.Response `json:"-"` 6896 // ContentKeys - ContentKeys used by current Streaming Locator 6897 ContentKeys *[]StreamingLocatorContentKey `json:"contentKeys,omitempty"` 6898} 6899 6900// ListPathsResponse class of response for listPaths action 6901type ListPathsResponse struct { 6902 autorest.Response `json:"-"` 6903 // StreamingPaths - Streaming Paths supported by current Streaming Locator 6904 StreamingPaths *[]StreamingPath `json:"streamingPaths,omitempty"` 6905 // DownloadPaths - Download Paths supported by current Streaming Locator 6906 DownloadPaths *[]string `json:"downloadPaths,omitempty"` 6907} 6908 6909// ListStreamingLocatorsResponse the Streaming Locators associated with this Asset. 6910type ListStreamingLocatorsResponse struct { 6911 autorest.Response `json:"-"` 6912 // StreamingLocators - READ-ONLY; The list of Streaming Locators. 6913 StreamingLocators *[]AssetStreamingLocator `json:"streamingLocators,omitempty"` 6914} 6915 6916// LiveEvent the Live Event. 6917type LiveEvent struct { 6918 autorest.Response `json:"-"` 6919 // LiveEventProperties - The Live Event properties. 6920 *LiveEventProperties `json:"properties,omitempty"` 6921 // Tags - Resource tags. 6922 Tags map[string]*string `json:"tags"` 6923 // Location - The Azure Region of the resource. 6924 Location *string `json:"location,omitempty"` 6925 // ID - READ-ONLY; Fully qualified resource ID for the resource. 6926 ID *string `json:"id,omitempty"` 6927 // Name - READ-ONLY; The name of the resource. 6928 Name *string `json:"name,omitempty"` 6929 // Type - READ-ONLY; The type of the resource. 6930 Type *string `json:"type,omitempty"` 6931} 6932 6933// MarshalJSON is the custom marshaler for LiveEvent. 6934func (le LiveEvent) MarshalJSON() ([]byte, error) { 6935 objectMap := make(map[string]interface{}) 6936 if le.LiveEventProperties != nil { 6937 objectMap["properties"] = le.LiveEventProperties 6938 } 6939 if le.Tags != nil { 6940 objectMap["tags"] = le.Tags 6941 } 6942 if le.Location != nil { 6943 objectMap["location"] = le.Location 6944 } 6945 return json.Marshal(objectMap) 6946} 6947 6948// UnmarshalJSON is the custom unmarshaler for LiveEvent struct. 6949func (le *LiveEvent) UnmarshalJSON(body []byte) error { 6950 var m map[string]*json.RawMessage 6951 err := json.Unmarshal(body, &m) 6952 if err != nil { 6953 return err 6954 } 6955 for k, v := range m { 6956 switch k { 6957 case "properties": 6958 if v != nil { 6959 var liveEventProperties LiveEventProperties 6960 err = json.Unmarshal(*v, &liveEventProperties) 6961 if err != nil { 6962 return err 6963 } 6964 le.LiveEventProperties = &liveEventProperties 6965 } 6966 case "tags": 6967 if v != nil { 6968 var tags map[string]*string 6969 err = json.Unmarshal(*v, &tags) 6970 if err != nil { 6971 return err 6972 } 6973 le.Tags = tags 6974 } 6975 case "location": 6976 if v != nil { 6977 var location string 6978 err = json.Unmarshal(*v, &location) 6979 if err != nil { 6980 return err 6981 } 6982 le.Location = &location 6983 } 6984 case "id": 6985 if v != nil { 6986 var ID string 6987 err = json.Unmarshal(*v, &ID) 6988 if err != nil { 6989 return err 6990 } 6991 le.ID = &ID 6992 } 6993 case "name": 6994 if v != nil { 6995 var name string 6996 err = json.Unmarshal(*v, &name) 6997 if err != nil { 6998 return err 6999 } 7000 le.Name = &name 7001 } 7002 case "type": 7003 if v != nil { 7004 var typeVar string 7005 err = json.Unmarshal(*v, &typeVar) 7006 if err != nil { 7007 return err 7008 } 7009 le.Type = &typeVar 7010 } 7011 } 7012 } 7013 7014 return nil 7015} 7016 7017// LiveEventActionInput the LiveEvent action input parameter definition. 7018type LiveEventActionInput struct { 7019 // RemoveOutputsOnStop - The flag indicates if remove LiveOutputs on Stop. 7020 RemoveOutputsOnStop *bool `json:"removeOutputsOnStop,omitempty"` 7021} 7022 7023// LiveEventEncoding the Live Event encoding. 7024type LiveEventEncoding struct { 7025 // EncodingType - The encoding type for Live Event. This value is specified at creation time and cannot be updated. Possible values include: 'LiveEventEncodingTypeNone', 'LiveEventEncodingTypeBasic', 'LiveEventEncodingTypeStandard', 'LiveEventEncodingTypePremium1080p' 7026 EncodingType LiveEventEncodingType `json:"encodingType,omitempty"` 7027 // PresetName - The encoding preset name. This value is specified at creation time and cannot be updated. 7028 PresetName *string `json:"presetName,omitempty"` 7029} 7030 7031// LiveEventEndpoint the Live Event endpoint. 7032type LiveEventEndpoint struct { 7033 // Protocol - The endpoint protocol. 7034 Protocol *string `json:"protocol,omitempty"` 7035 // URL - The endpoint URL. 7036 URL *string `json:"url,omitempty"` 7037} 7038 7039// LiveEventInput the Live Event input. 7040type LiveEventInput struct { 7041 // StreamingProtocol - The streaming protocol for the Live Event. This is specified at creation time and cannot be updated. Possible values include: 'FragmentedMP4', 'RTMP' 7042 StreamingProtocol LiveEventInputProtocol `json:"streamingProtocol,omitempty"` 7043 // AccessControl - The access control for LiveEvent Input. 7044 AccessControl *LiveEventInputAccessControl `json:"accessControl,omitempty"` 7045 // KeyFrameIntervalDuration - ISO 8601 timespan duration of the key frame interval duration. 7046 KeyFrameIntervalDuration *string `json:"keyFrameIntervalDuration,omitempty"` 7047 // AccessToken - A unique identifier for a stream. This can be specified at creation time but cannot be updated. If omitted, the service will generate a unique value. 7048 AccessToken *string `json:"accessToken,omitempty"` 7049 // Endpoints - The input endpoints for the Live Event. 7050 Endpoints *[]LiveEventEndpoint `json:"endpoints,omitempty"` 7051} 7052 7053// LiveEventInputAccessControl the IP access control for Live Event Input. 7054type LiveEventInputAccessControl struct { 7055 // IP - The IP access control properties. 7056 IP *IPAccessControl `json:"ip,omitempty"` 7057} 7058 7059// LiveEventListResult the LiveEvent list result. 7060type LiveEventListResult struct { 7061 autorest.Response `json:"-"` 7062 // Value - The result of the List Live Event operation. 7063 Value *[]LiveEvent `json:"value,omitempty"` 7064 // OdataCount - The number of result. 7065 OdataCount *int32 `json:"@odata.count,omitempty"` 7066 // OdataNextLink - Th link to the next set of results. Not empty if value contains incomplete list of Live Outputs. 7067 OdataNextLink *string `json:"@odata.nextLink,omitempty"` 7068} 7069 7070// LiveEventListResultIterator provides access to a complete listing of LiveEvent values. 7071type LiveEventListResultIterator struct { 7072 i int 7073 page LiveEventListResultPage 7074} 7075 7076// NextWithContext advances to the next value. If there was an error making 7077// the request the iterator does not advance and the error is returned. 7078func (iter *LiveEventListResultIterator) NextWithContext(ctx context.Context) (err error) { 7079 if tracing.IsEnabled() { 7080 ctx = tracing.StartSpan(ctx, fqdn+"/LiveEventListResultIterator.NextWithContext") 7081 defer func() { 7082 sc := -1 7083 if iter.Response().Response.Response != nil { 7084 sc = iter.Response().Response.Response.StatusCode 7085 } 7086 tracing.EndSpan(ctx, sc, err) 7087 }() 7088 } 7089 iter.i++ 7090 if iter.i < len(iter.page.Values()) { 7091 return nil 7092 } 7093 err = iter.page.NextWithContext(ctx) 7094 if err != nil { 7095 iter.i-- 7096 return err 7097 } 7098 iter.i = 0 7099 return nil 7100} 7101 7102// Next advances to the next value. If there was an error making 7103// the request the iterator does not advance and the error is returned. 7104// Deprecated: Use NextWithContext() instead. 7105func (iter *LiveEventListResultIterator) Next() error { 7106 return iter.NextWithContext(context.Background()) 7107} 7108 7109// NotDone returns true if the enumeration should be started or is not yet complete. 7110func (iter LiveEventListResultIterator) NotDone() bool { 7111 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7112} 7113 7114// Response returns the raw server response from the last page request. 7115func (iter LiveEventListResultIterator) Response() LiveEventListResult { 7116 return iter.page.Response() 7117} 7118 7119// Value returns the current value or a zero-initialized value if the 7120// iterator has advanced beyond the end of the collection. 7121func (iter LiveEventListResultIterator) Value() LiveEvent { 7122 if !iter.page.NotDone() { 7123 return LiveEvent{} 7124 } 7125 return iter.page.Values()[iter.i] 7126} 7127 7128// Creates a new instance of the LiveEventListResultIterator type. 7129func NewLiveEventListResultIterator(page LiveEventListResultPage) LiveEventListResultIterator { 7130 return LiveEventListResultIterator{page: page} 7131} 7132 7133// IsEmpty returns true if the ListResult contains no values. 7134func (lelr LiveEventListResult) IsEmpty() bool { 7135 return lelr.Value == nil || len(*lelr.Value) == 0 7136} 7137 7138// liveEventListResultPreparer prepares a request to retrieve the next set of results. 7139// It returns nil if no more results exist. 7140func (lelr LiveEventListResult) liveEventListResultPreparer(ctx context.Context) (*http.Request, error) { 7141 if lelr.OdataNextLink == nil || len(to.String(lelr.OdataNextLink)) < 1 { 7142 return nil, nil 7143 } 7144 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7145 autorest.AsJSON(), 7146 autorest.AsGet(), 7147 autorest.WithBaseURL(to.String(lelr.OdataNextLink))) 7148} 7149 7150// LiveEventListResultPage contains a page of LiveEvent values. 7151type LiveEventListResultPage struct { 7152 fn func(context.Context, LiveEventListResult) (LiveEventListResult, error) 7153 lelr LiveEventListResult 7154} 7155 7156// NextWithContext advances to the next page of values. If there was an error making 7157// the request the page does not advance and the error is returned. 7158func (page *LiveEventListResultPage) NextWithContext(ctx context.Context) (err error) { 7159 if tracing.IsEnabled() { 7160 ctx = tracing.StartSpan(ctx, fqdn+"/LiveEventListResultPage.NextWithContext") 7161 defer func() { 7162 sc := -1 7163 if page.Response().Response.Response != nil { 7164 sc = page.Response().Response.Response.StatusCode 7165 } 7166 tracing.EndSpan(ctx, sc, err) 7167 }() 7168 } 7169 next, err := page.fn(ctx, page.lelr) 7170 if err != nil { 7171 return err 7172 } 7173 page.lelr = next 7174 return nil 7175} 7176 7177// Next advances to the next page of values. If there was an error making 7178// the request the page does not advance and the error is returned. 7179// Deprecated: Use NextWithContext() instead. 7180func (page *LiveEventListResultPage) Next() error { 7181 return page.NextWithContext(context.Background()) 7182} 7183 7184// NotDone returns true if the page enumeration should be started or is not yet complete. 7185func (page LiveEventListResultPage) NotDone() bool { 7186 return !page.lelr.IsEmpty() 7187} 7188 7189// Response returns the raw server response from the last page request. 7190func (page LiveEventListResultPage) Response() LiveEventListResult { 7191 return page.lelr 7192} 7193 7194// Values returns the slice of values for the current page or nil if there are no values. 7195func (page LiveEventListResultPage) Values() []LiveEvent { 7196 if page.lelr.IsEmpty() { 7197 return nil 7198 } 7199 return *page.lelr.Value 7200} 7201 7202// Creates a new instance of the LiveEventListResultPage type. 7203func NewLiveEventListResultPage(getNextPage func(context.Context, LiveEventListResult) (LiveEventListResult, error)) LiveEventListResultPage { 7204 return LiveEventListResultPage{fn: getNextPage} 7205} 7206 7207// LiveEventPreview the Live Event preview. 7208type LiveEventPreview struct { 7209 // Endpoints - The endpoints for preview. 7210 Endpoints *[]LiveEventEndpoint `json:"endpoints,omitempty"` 7211 // AccessControl - The access control for LiveEvent preview. 7212 AccessControl *LiveEventPreviewAccessControl `json:"accessControl,omitempty"` 7213 // PreviewLocator - The identifier of the preview locator in Guid format. Specifying this at creation time allows the caller to know the preview locator url before the event is created. If omitted, the service will generate a random identifier. This value cannot be updated once the live event is created. 7214 PreviewLocator *string `json:"previewLocator,omitempty"` 7215 // StreamingPolicyName - The name of streaming policy used for the LiveEvent preview. This value is specified at creation time and cannot be updated. 7216 StreamingPolicyName *string `json:"streamingPolicyName,omitempty"` 7217 // AlternativeMediaID - An Alternative Media Identifier associated with the StreamingLocator created for the preview. This value is specified at creation time and cannot be updated. The identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the StreamingPolicyName field. 7218 AlternativeMediaID *string `json:"alternativeMediaId,omitempty"` 7219} 7220 7221// LiveEventPreviewAccessControl the IP access control for Live Event preview. 7222type LiveEventPreviewAccessControl struct { 7223 // IP - The IP access control properties. 7224 IP *IPAccessControl `json:"ip,omitempty"` 7225} 7226 7227// LiveEventProperties the Live Event properties. 7228type LiveEventProperties struct { 7229 // Description - The Live Event description. 7230 Description *string `json:"description,omitempty"` 7231 // Input - The Live Event input. 7232 Input *LiveEventInput `json:"input,omitempty"` 7233 // Preview - The Live Event preview. 7234 Preview *LiveEventPreview `json:"preview,omitempty"` 7235 // Encoding - The Live Event encoding. 7236 Encoding *LiveEventEncoding `json:"encoding,omitempty"` 7237 // ProvisioningState - READ-ONLY; The provisioning state of the Live Event. 7238 ProvisioningState *string `json:"provisioningState,omitempty"` 7239 // ResourceState - READ-ONLY; The resource state of the Live Event. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting' 7240 ResourceState LiveEventResourceState `json:"resourceState,omitempty"` 7241 // CrossSiteAccessPolicies - The Live Event access policies. 7242 CrossSiteAccessPolicies *CrossSiteAccessPolicies `json:"crossSiteAccessPolicies,omitempty"` 7243 // VanityURL - Specifies whether to use a vanity url with the Live Event. This value is specified at creation time and cannot be updated. 7244 VanityURL *bool `json:"vanityUrl,omitempty"` 7245 // StreamOptions - The options to use for the LiveEvent. This value is specified at creation time and cannot be updated. 7246 StreamOptions *[]StreamOptionsFlag `json:"streamOptions,omitempty"` 7247 // Created - READ-ONLY; The exact time the Live Event was created. 7248 Created *date.Time `json:"created,omitempty"` 7249 // LastModified - READ-ONLY; The exact time the Live Event was last modified. 7250 LastModified *date.Time `json:"lastModified,omitempty"` 7251} 7252 7253// LiveEventsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 7254// operation. 7255type LiveEventsCreateFuture struct { 7256 azure.Future 7257} 7258 7259// Result returns the result of the asynchronous operation. 7260// If the operation has not completed it will return an error. 7261func (future *LiveEventsCreateFuture) Result(client LiveEventsClient) (le LiveEvent, err error) { 7262 var done bool 7263 done, err = future.DoneWithContext(context.Background(), client) 7264 if err != nil { 7265 err = autorest.NewErrorWithError(err, "media.LiveEventsCreateFuture", "Result", future.Response(), "Polling failure") 7266 return 7267 } 7268 if !done { 7269 err = azure.NewAsyncOpIncompleteError("media.LiveEventsCreateFuture") 7270 return 7271 } 7272 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7273 if le.Response.Response, err = future.GetResult(sender); err == nil && le.Response.Response.StatusCode != http.StatusNoContent { 7274 le, err = client.CreateResponder(le.Response.Response) 7275 if err != nil { 7276 err = autorest.NewErrorWithError(err, "media.LiveEventsCreateFuture", "Result", le.Response.Response, "Failure responding to request") 7277 } 7278 } 7279 return 7280} 7281 7282// LiveEventsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 7283// operation. 7284type LiveEventsDeleteFuture struct { 7285 azure.Future 7286} 7287 7288// Result returns the result of the asynchronous operation. 7289// If the operation has not completed it will return an error. 7290func (future *LiveEventsDeleteFuture) Result(client LiveEventsClient) (ar autorest.Response, err error) { 7291 var done bool 7292 done, err = future.DoneWithContext(context.Background(), client) 7293 if err != nil { 7294 err = autorest.NewErrorWithError(err, "media.LiveEventsDeleteFuture", "Result", future.Response(), "Polling failure") 7295 return 7296 } 7297 if !done { 7298 err = azure.NewAsyncOpIncompleteError("media.LiveEventsDeleteFuture") 7299 return 7300 } 7301 ar.Response = future.Response() 7302 return 7303} 7304 7305// LiveEventsResetFuture an abstraction for monitoring and retrieving the results of a long-running 7306// operation. 7307type LiveEventsResetFuture struct { 7308 azure.Future 7309} 7310 7311// Result returns the result of the asynchronous operation. 7312// If the operation has not completed it will return an error. 7313func (future *LiveEventsResetFuture) Result(client LiveEventsClient) (ar autorest.Response, err error) { 7314 var done bool 7315 done, err = future.DoneWithContext(context.Background(), client) 7316 if err != nil { 7317 err = autorest.NewErrorWithError(err, "media.LiveEventsResetFuture", "Result", future.Response(), "Polling failure") 7318 return 7319 } 7320 if !done { 7321 err = azure.NewAsyncOpIncompleteError("media.LiveEventsResetFuture") 7322 return 7323 } 7324 ar.Response = future.Response() 7325 return 7326} 7327 7328// LiveEventsStartFuture an abstraction for monitoring and retrieving the results of a long-running 7329// operation. 7330type LiveEventsStartFuture struct { 7331 azure.Future 7332} 7333 7334// Result returns the result of the asynchronous operation. 7335// If the operation has not completed it will return an error. 7336func (future *LiveEventsStartFuture) Result(client LiveEventsClient) (ar autorest.Response, err error) { 7337 var done bool 7338 done, err = future.DoneWithContext(context.Background(), client) 7339 if err != nil { 7340 err = autorest.NewErrorWithError(err, "media.LiveEventsStartFuture", "Result", future.Response(), "Polling failure") 7341 return 7342 } 7343 if !done { 7344 err = azure.NewAsyncOpIncompleteError("media.LiveEventsStartFuture") 7345 return 7346 } 7347 ar.Response = future.Response() 7348 return 7349} 7350 7351// LiveEventsStopFuture an abstraction for monitoring and retrieving the results of a long-running 7352// operation. 7353type LiveEventsStopFuture struct { 7354 azure.Future 7355} 7356 7357// Result returns the result of the asynchronous operation. 7358// If the operation has not completed it will return an error. 7359func (future *LiveEventsStopFuture) Result(client LiveEventsClient) (ar autorest.Response, err error) { 7360 var done bool 7361 done, err = future.DoneWithContext(context.Background(), client) 7362 if err != nil { 7363 err = autorest.NewErrorWithError(err, "media.LiveEventsStopFuture", "Result", future.Response(), "Polling failure") 7364 return 7365 } 7366 if !done { 7367 err = azure.NewAsyncOpIncompleteError("media.LiveEventsStopFuture") 7368 return 7369 } 7370 ar.Response = future.Response() 7371 return 7372} 7373 7374// LiveEventsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 7375// operation. 7376type LiveEventsUpdateFuture struct { 7377 azure.Future 7378} 7379 7380// Result returns the result of the asynchronous operation. 7381// If the operation has not completed it will return an error. 7382func (future *LiveEventsUpdateFuture) Result(client LiveEventsClient) (le LiveEvent, err error) { 7383 var done bool 7384 done, err = future.DoneWithContext(context.Background(), client) 7385 if err != nil { 7386 err = autorest.NewErrorWithError(err, "media.LiveEventsUpdateFuture", "Result", future.Response(), "Polling failure") 7387 return 7388 } 7389 if !done { 7390 err = azure.NewAsyncOpIncompleteError("media.LiveEventsUpdateFuture") 7391 return 7392 } 7393 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7394 if le.Response.Response, err = future.GetResult(sender); err == nil && le.Response.Response.StatusCode != http.StatusNoContent { 7395 le, err = client.UpdateResponder(le.Response.Response) 7396 if err != nil { 7397 err = autorest.NewErrorWithError(err, "media.LiveEventsUpdateFuture", "Result", le.Response.Response, "Failure responding to request") 7398 } 7399 } 7400 return 7401} 7402 7403// LiveOutput the Live Output. 7404type LiveOutput struct { 7405 autorest.Response `json:"-"` 7406 // LiveOutputProperties - The Live Output properties. 7407 *LiveOutputProperties `json:"properties,omitempty"` 7408 // ID - READ-ONLY; Fully qualified resource ID for the resource. 7409 ID *string `json:"id,omitempty"` 7410 // Name - READ-ONLY; The name of the resource. 7411 Name *string `json:"name,omitempty"` 7412 // Type - READ-ONLY; The type of the resource. 7413 Type *string `json:"type,omitempty"` 7414} 7415 7416// MarshalJSON is the custom marshaler for LiveOutput. 7417func (lo LiveOutput) MarshalJSON() ([]byte, error) { 7418 objectMap := make(map[string]interface{}) 7419 if lo.LiveOutputProperties != nil { 7420 objectMap["properties"] = lo.LiveOutputProperties 7421 } 7422 return json.Marshal(objectMap) 7423} 7424 7425// UnmarshalJSON is the custom unmarshaler for LiveOutput struct. 7426func (lo *LiveOutput) UnmarshalJSON(body []byte) error { 7427 var m map[string]*json.RawMessage 7428 err := json.Unmarshal(body, &m) 7429 if err != nil { 7430 return err 7431 } 7432 for k, v := range m { 7433 switch k { 7434 case "properties": 7435 if v != nil { 7436 var liveOutputProperties LiveOutputProperties 7437 err = json.Unmarshal(*v, &liveOutputProperties) 7438 if err != nil { 7439 return err 7440 } 7441 lo.LiveOutputProperties = &liveOutputProperties 7442 } 7443 case "id": 7444 if v != nil { 7445 var ID string 7446 err = json.Unmarshal(*v, &ID) 7447 if err != nil { 7448 return err 7449 } 7450 lo.ID = &ID 7451 } 7452 case "name": 7453 if v != nil { 7454 var name string 7455 err = json.Unmarshal(*v, &name) 7456 if err != nil { 7457 return err 7458 } 7459 lo.Name = &name 7460 } 7461 case "type": 7462 if v != nil { 7463 var typeVar string 7464 err = json.Unmarshal(*v, &typeVar) 7465 if err != nil { 7466 return err 7467 } 7468 lo.Type = &typeVar 7469 } 7470 } 7471 } 7472 7473 return nil 7474} 7475 7476// LiveOutputListResult the LiveOutput list result. 7477type LiveOutputListResult struct { 7478 autorest.Response `json:"-"` 7479 // Value - The result of the List Live Output operation. 7480 Value *[]LiveOutput `json:"value,omitempty"` 7481 // OdataCount - The number of result. 7482 OdataCount *int32 `json:"@odata.count,omitempty"` 7483 // OdataNextLink - Th link to the next set of results. Not empty if value contains incomplete list of Live Outputs. 7484 OdataNextLink *string `json:"@odata.nextLink,omitempty"` 7485} 7486 7487// LiveOutputListResultIterator provides access to a complete listing of LiveOutput values. 7488type LiveOutputListResultIterator struct { 7489 i int 7490 page LiveOutputListResultPage 7491} 7492 7493// NextWithContext advances to the next value. If there was an error making 7494// the request the iterator does not advance and the error is returned. 7495func (iter *LiveOutputListResultIterator) NextWithContext(ctx context.Context) (err error) { 7496 if tracing.IsEnabled() { 7497 ctx = tracing.StartSpan(ctx, fqdn+"/LiveOutputListResultIterator.NextWithContext") 7498 defer func() { 7499 sc := -1 7500 if iter.Response().Response.Response != nil { 7501 sc = iter.Response().Response.Response.StatusCode 7502 } 7503 tracing.EndSpan(ctx, sc, err) 7504 }() 7505 } 7506 iter.i++ 7507 if iter.i < len(iter.page.Values()) { 7508 return nil 7509 } 7510 err = iter.page.NextWithContext(ctx) 7511 if err != nil { 7512 iter.i-- 7513 return err 7514 } 7515 iter.i = 0 7516 return nil 7517} 7518 7519// Next advances to the next value. If there was an error making 7520// the request the iterator does not advance and the error is returned. 7521// Deprecated: Use NextWithContext() instead. 7522func (iter *LiveOutputListResultIterator) Next() error { 7523 return iter.NextWithContext(context.Background()) 7524} 7525 7526// NotDone returns true if the enumeration should be started or is not yet complete. 7527func (iter LiveOutputListResultIterator) NotDone() bool { 7528 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7529} 7530 7531// Response returns the raw server response from the last page request. 7532func (iter LiveOutputListResultIterator) Response() LiveOutputListResult { 7533 return iter.page.Response() 7534} 7535 7536// Value returns the current value or a zero-initialized value if the 7537// iterator has advanced beyond the end of the collection. 7538func (iter LiveOutputListResultIterator) Value() LiveOutput { 7539 if !iter.page.NotDone() { 7540 return LiveOutput{} 7541 } 7542 return iter.page.Values()[iter.i] 7543} 7544 7545// Creates a new instance of the LiveOutputListResultIterator type. 7546func NewLiveOutputListResultIterator(page LiveOutputListResultPage) LiveOutputListResultIterator { 7547 return LiveOutputListResultIterator{page: page} 7548} 7549 7550// IsEmpty returns true if the ListResult contains no values. 7551func (lolr LiveOutputListResult) IsEmpty() bool { 7552 return lolr.Value == nil || len(*lolr.Value) == 0 7553} 7554 7555// liveOutputListResultPreparer prepares a request to retrieve the next set of results. 7556// It returns nil if no more results exist. 7557func (lolr LiveOutputListResult) liveOutputListResultPreparer(ctx context.Context) (*http.Request, error) { 7558 if lolr.OdataNextLink == nil || len(to.String(lolr.OdataNextLink)) < 1 { 7559 return nil, nil 7560 } 7561 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7562 autorest.AsJSON(), 7563 autorest.AsGet(), 7564 autorest.WithBaseURL(to.String(lolr.OdataNextLink))) 7565} 7566 7567// LiveOutputListResultPage contains a page of LiveOutput values. 7568type LiveOutputListResultPage struct { 7569 fn func(context.Context, LiveOutputListResult) (LiveOutputListResult, error) 7570 lolr LiveOutputListResult 7571} 7572 7573// NextWithContext advances to the next page of values. If there was an error making 7574// the request the page does not advance and the error is returned. 7575func (page *LiveOutputListResultPage) NextWithContext(ctx context.Context) (err error) { 7576 if tracing.IsEnabled() { 7577 ctx = tracing.StartSpan(ctx, fqdn+"/LiveOutputListResultPage.NextWithContext") 7578 defer func() { 7579 sc := -1 7580 if page.Response().Response.Response != nil { 7581 sc = page.Response().Response.Response.StatusCode 7582 } 7583 tracing.EndSpan(ctx, sc, err) 7584 }() 7585 } 7586 next, err := page.fn(ctx, page.lolr) 7587 if err != nil { 7588 return err 7589 } 7590 page.lolr = next 7591 return nil 7592} 7593 7594// Next advances to the next page of values. If there was an error making 7595// the request the page does not advance and the error is returned. 7596// Deprecated: Use NextWithContext() instead. 7597func (page *LiveOutputListResultPage) Next() error { 7598 return page.NextWithContext(context.Background()) 7599} 7600 7601// NotDone returns true if the page enumeration should be started or is not yet complete. 7602func (page LiveOutputListResultPage) NotDone() bool { 7603 return !page.lolr.IsEmpty() 7604} 7605 7606// Response returns the raw server response from the last page request. 7607func (page LiveOutputListResultPage) Response() LiveOutputListResult { 7608 return page.lolr 7609} 7610 7611// Values returns the slice of values for the current page or nil if there are no values. 7612func (page LiveOutputListResultPage) Values() []LiveOutput { 7613 if page.lolr.IsEmpty() { 7614 return nil 7615 } 7616 return *page.lolr.Value 7617} 7618 7619// Creates a new instance of the LiveOutputListResultPage type. 7620func NewLiveOutputListResultPage(getNextPage func(context.Context, LiveOutputListResult) (LiveOutputListResult, error)) LiveOutputListResultPage { 7621 return LiveOutputListResultPage{fn: getNextPage} 7622} 7623 7624// LiveOutputProperties the JSON object that contains the properties required to create a Live Output. 7625type LiveOutputProperties struct { 7626 // Description - The description of the Live Output. 7627 Description *string `json:"description,omitempty"` 7628 // AssetName - The asset name. 7629 AssetName *string `json:"assetName,omitempty"` 7630 // ArchiveWindowLength - ISO 8601 timespan duration of the archive window length. This is duration that customer want to retain the recorded content. 7631 ArchiveWindowLength *string `json:"archiveWindowLength,omitempty"` 7632 // ManifestName - The manifest file name. If not provided, the service will generate one automatically. 7633 ManifestName *string `json:"manifestName,omitempty"` 7634 // Hls - The HLS configuration. 7635 Hls *Hls `json:"hls,omitempty"` 7636 // OutputSnapTime - The output snapshot time. 7637 OutputSnapTime *int64 `json:"outputSnapTime,omitempty"` 7638 // Created - READ-ONLY; The exact time the Live Output was created. 7639 Created *date.Time `json:"created,omitempty"` 7640 // LastModified - READ-ONLY; The exact time the Live Output was last modified. 7641 LastModified *date.Time `json:"lastModified,omitempty"` 7642 // ProvisioningState - READ-ONLY; The provisioning state of the Live Output. 7643 ProvisioningState *string `json:"provisioningState,omitempty"` 7644 // ResourceState - READ-ONLY; The resource state of the Live Output. Possible values include: 'LiveOutputResourceStateCreating', 'LiveOutputResourceStateRunning', 'LiveOutputResourceStateDeleting' 7645 ResourceState LiveOutputResourceState `json:"resourceState,omitempty"` 7646} 7647 7648// LiveOutputsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 7649// operation. 7650type LiveOutputsCreateFuture struct { 7651 azure.Future 7652} 7653 7654// Result returns the result of the asynchronous operation. 7655// If the operation has not completed it will return an error. 7656func (future *LiveOutputsCreateFuture) Result(client LiveOutputsClient) (lo LiveOutput, err error) { 7657 var done bool 7658 done, err = future.DoneWithContext(context.Background(), client) 7659 if err != nil { 7660 err = autorest.NewErrorWithError(err, "media.LiveOutputsCreateFuture", "Result", future.Response(), "Polling failure") 7661 return 7662 } 7663 if !done { 7664 err = azure.NewAsyncOpIncompleteError("media.LiveOutputsCreateFuture") 7665 return 7666 } 7667 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7668 if lo.Response.Response, err = future.GetResult(sender); err == nil && lo.Response.Response.StatusCode != http.StatusNoContent { 7669 lo, err = client.CreateResponder(lo.Response.Response) 7670 if err != nil { 7671 err = autorest.NewErrorWithError(err, "media.LiveOutputsCreateFuture", "Result", lo.Response.Response, "Failure responding to request") 7672 } 7673 } 7674 return 7675} 7676 7677// LiveOutputsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 7678// operation. 7679type LiveOutputsDeleteFuture struct { 7680 azure.Future 7681} 7682 7683// Result returns the result of the asynchronous operation. 7684// If the operation has not completed it will return an error. 7685func (future *LiveOutputsDeleteFuture) Result(client LiveOutputsClient) (ar autorest.Response, err error) { 7686 var done bool 7687 done, err = future.DoneWithContext(context.Background(), client) 7688 if err != nil { 7689 err = autorest.NewErrorWithError(err, "media.LiveOutputsDeleteFuture", "Result", future.Response(), "Polling failure") 7690 return 7691 } 7692 if !done { 7693 err = azure.NewAsyncOpIncompleteError("media.LiveOutputsDeleteFuture") 7694 return 7695 } 7696 ar.Response = future.Response() 7697 return 7698} 7699 7700// Location ... 7701type Location struct { 7702 Name *string `json:"name,omitempty"` 7703} 7704 7705// Metric a metric emitted by service. 7706type Metric struct { 7707 // Name - READ-ONLY; The metric name. 7708 Name *string `json:"name,omitempty"` 7709 // DisplayName - READ-ONLY; The metric display name. 7710 DisplayName *string `json:"displayName,omitempty"` 7711 // DisplayDescription - READ-ONLY; The metric display description. 7712 DisplayDescription *string `json:"displayDescription,omitempty"` 7713 // Unit - READ-ONLY; The metric unit. Possible values include: 'MetricUnitBytes', 'MetricUnitCount', 'MetricUnitMilliseconds' 7714 Unit MetricUnit `json:"unit,omitempty"` 7715 // AggregationType - READ-ONLY; The metric aggregation type. Possible values include: 'Average', 'Count', 'Total' 7716 AggregationType MetricAggregationType `json:"aggregationType,omitempty"` 7717 // Dimensions - READ-ONLY; The metric dimensions. 7718 Dimensions *[]MetricDimension `json:"dimensions,omitempty"` 7719} 7720 7721// MetricDimension a metric dimension. 7722type MetricDimension struct { 7723 // Name - READ-ONLY; The metric dimension name. 7724 Name *string `json:"name,omitempty"` 7725 // DisplayName - READ-ONLY; The display name for the dimension. 7726 DisplayName *string `json:"displayName,omitempty"` 7727 // ToBeExportedForShoebox - READ-ONLY; Whether to export metric to shoebox. 7728 ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` 7729} 7730 7731// MetricProperties metric properties. 7732type MetricProperties struct { 7733 // ServiceSpecification - READ-ONLY; The service specifications. 7734 ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` 7735} 7736 7737// Mp4Format describes the properties for an output ISO MP4 file. 7738type Mp4Format struct { 7739 // OutputFiles - The list of output files to produce. Each entry in the list is a set of audio and video layer labels to be muxed together . 7740 OutputFiles *[]OutputFile `json:"outputFiles,omitempty"` 7741 // FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. 7742 FilenamePattern *string `json:"filenamePattern,omitempty"` 7743 // OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat' 7744 OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"` 7745} 7746 7747// MarshalJSON is the custom marshaler for Mp4Format. 7748func (m4f Mp4Format) MarshalJSON() ([]byte, error) { 7749 m4f.OdataType = OdataTypeMicrosoftMediaMp4Format 7750 objectMap := make(map[string]interface{}) 7751 if m4f.OutputFiles != nil { 7752 objectMap["outputFiles"] = m4f.OutputFiles 7753 } 7754 if m4f.FilenamePattern != nil { 7755 objectMap["filenamePattern"] = m4f.FilenamePattern 7756 } 7757 if m4f.OdataType != "" { 7758 objectMap["@odata.type"] = m4f.OdataType 7759 } 7760 return json.Marshal(objectMap) 7761} 7762 7763// AsImageFormat is the BasicFormat implementation for Mp4Format. 7764func (m4f Mp4Format) AsImageFormat() (*ImageFormat, bool) { 7765 return nil, false 7766} 7767 7768// AsBasicImageFormat is the BasicFormat implementation for Mp4Format. 7769func (m4f Mp4Format) AsBasicImageFormat() (BasicImageFormat, bool) { 7770 return nil, false 7771} 7772 7773// AsJpgFormat is the BasicFormat implementation for Mp4Format. 7774func (m4f Mp4Format) AsJpgFormat() (*JpgFormat, bool) { 7775 return nil, false 7776} 7777 7778// AsPngFormat is the BasicFormat implementation for Mp4Format. 7779func (m4f Mp4Format) AsPngFormat() (*PngFormat, bool) { 7780 return nil, false 7781} 7782 7783// AsMultiBitrateFormat is the BasicFormat implementation for Mp4Format. 7784func (m4f Mp4Format) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) { 7785 return nil, false 7786} 7787 7788// AsBasicMultiBitrateFormat is the BasicFormat implementation for Mp4Format. 7789func (m4f Mp4Format) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) { 7790 return &m4f, true 7791} 7792 7793// AsMp4Format is the BasicFormat implementation for Mp4Format. 7794func (m4f Mp4Format) AsMp4Format() (*Mp4Format, bool) { 7795 return &m4f, true 7796} 7797 7798// AsTransportStreamFormat is the BasicFormat implementation for Mp4Format. 7799func (m4f Mp4Format) AsTransportStreamFormat() (*TransportStreamFormat, bool) { 7800 return nil, false 7801} 7802 7803// AsFormat is the BasicFormat implementation for Mp4Format. 7804func (m4f Mp4Format) AsFormat() (*Format, bool) { 7805 return nil, false 7806} 7807 7808// AsBasicFormat is the BasicFormat implementation for Mp4Format. 7809func (m4f Mp4Format) AsBasicFormat() (BasicFormat, bool) { 7810 return &m4f, true 7811} 7812 7813// BasicMultiBitrateFormat describes the properties for producing a collection of GOP aligned multi-bitrate files. The 7814// default behavior is to produce one output file for each video layer which is muxed together with all the audios. The 7815// exact output files produced can be controlled by specifying the outputFiles collection. 7816type BasicMultiBitrateFormat interface { 7817 AsMp4Format() (*Mp4Format, bool) 7818 AsTransportStreamFormat() (*TransportStreamFormat, bool) 7819 AsMultiBitrateFormat() (*MultiBitrateFormat, bool) 7820} 7821 7822// MultiBitrateFormat describes the properties for producing a collection of GOP aligned multi-bitrate files. 7823// The default behavior is to produce one output file for each video layer which is muxed together with all the 7824// audios. The exact output files produced can be controlled by specifying the outputFiles collection. 7825type MultiBitrateFormat struct { 7826 // OutputFiles - The list of output files to produce. Each entry in the list is a set of audio and video layer labels to be muxed together . 7827 OutputFiles *[]OutputFile `json:"outputFiles,omitempty"` 7828 // FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. 7829 FilenamePattern *string `json:"filenamePattern,omitempty"` 7830 // OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat' 7831 OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"` 7832} 7833 7834func unmarshalBasicMultiBitrateFormat(body []byte) (BasicMultiBitrateFormat, error) { 7835 var m map[string]interface{} 7836 err := json.Unmarshal(body, &m) 7837 if err != nil { 7838 return nil, err 7839 } 7840 7841 switch m["@odata.type"] { 7842 case string(OdataTypeMicrosoftMediaMp4Format): 7843 var m4f Mp4Format 7844 err := json.Unmarshal(body, &m4f) 7845 return m4f, err 7846 case string(OdataTypeMicrosoftMediaTransportStreamFormat): 7847 var tsf TransportStreamFormat 7848 err := json.Unmarshal(body, &tsf) 7849 return tsf, err 7850 default: 7851 var mbf MultiBitrateFormat 7852 err := json.Unmarshal(body, &mbf) 7853 return mbf, err 7854 } 7855} 7856func unmarshalBasicMultiBitrateFormatArray(body []byte) ([]BasicMultiBitrateFormat, error) { 7857 var rawMessages []*json.RawMessage 7858 err := json.Unmarshal(body, &rawMessages) 7859 if err != nil { 7860 return nil, err 7861 } 7862 7863 mbfArray := make([]BasicMultiBitrateFormat, len(rawMessages)) 7864 7865 for index, rawMessage := range rawMessages { 7866 mbf, err := unmarshalBasicMultiBitrateFormat(*rawMessage) 7867 if err != nil { 7868 return nil, err 7869 } 7870 mbfArray[index] = mbf 7871 } 7872 return mbfArray, nil 7873} 7874 7875// MarshalJSON is the custom marshaler for MultiBitrateFormat. 7876func (mbf MultiBitrateFormat) MarshalJSON() ([]byte, error) { 7877 mbf.OdataType = OdataTypeMicrosoftMediaMultiBitrateFormat 7878 objectMap := make(map[string]interface{}) 7879 if mbf.OutputFiles != nil { 7880 objectMap["outputFiles"] = mbf.OutputFiles 7881 } 7882 if mbf.FilenamePattern != nil { 7883 objectMap["filenamePattern"] = mbf.FilenamePattern 7884 } 7885 if mbf.OdataType != "" { 7886 objectMap["@odata.type"] = mbf.OdataType 7887 } 7888 return json.Marshal(objectMap) 7889} 7890 7891// AsImageFormat is the BasicFormat implementation for MultiBitrateFormat. 7892func (mbf MultiBitrateFormat) AsImageFormat() (*ImageFormat, bool) { 7893 return nil, false 7894} 7895 7896// AsBasicImageFormat is the BasicFormat implementation for MultiBitrateFormat. 7897func (mbf MultiBitrateFormat) AsBasicImageFormat() (BasicImageFormat, bool) { 7898 return nil, false 7899} 7900 7901// AsJpgFormat is the BasicFormat implementation for MultiBitrateFormat. 7902func (mbf MultiBitrateFormat) AsJpgFormat() (*JpgFormat, bool) { 7903 return nil, false 7904} 7905 7906// AsPngFormat is the BasicFormat implementation for MultiBitrateFormat. 7907func (mbf MultiBitrateFormat) AsPngFormat() (*PngFormat, bool) { 7908 return nil, false 7909} 7910 7911// AsMultiBitrateFormat is the BasicFormat implementation for MultiBitrateFormat. 7912func (mbf MultiBitrateFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) { 7913 return &mbf, true 7914} 7915 7916// AsBasicMultiBitrateFormat is the BasicFormat implementation for MultiBitrateFormat. 7917func (mbf MultiBitrateFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) { 7918 return &mbf, true 7919} 7920 7921// AsMp4Format is the BasicFormat implementation for MultiBitrateFormat. 7922func (mbf MultiBitrateFormat) AsMp4Format() (*Mp4Format, bool) { 7923 return nil, false 7924} 7925 7926// AsTransportStreamFormat is the BasicFormat implementation for MultiBitrateFormat. 7927func (mbf MultiBitrateFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) { 7928 return nil, false 7929} 7930 7931// AsFormat is the BasicFormat implementation for MultiBitrateFormat. 7932func (mbf MultiBitrateFormat) AsFormat() (*Format, bool) { 7933 return nil, false 7934} 7935 7936// AsBasicFormat is the BasicFormat implementation for MultiBitrateFormat. 7937func (mbf MultiBitrateFormat) AsBasicFormat() (BasicFormat, bool) { 7938 return &mbf, true 7939} 7940 7941// NoEncryption class for NoEncryption scheme 7942type NoEncryption struct { 7943 // EnabledProtocols - Representing supported protocols 7944 EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"` 7945} 7946 7947// ODataError information about an error. 7948type ODataError struct { 7949 // Code - A language-independent error name. 7950 Code *string `json:"code,omitempty"` 7951 // Message - The error message. 7952 Message *string `json:"message,omitempty"` 7953 // Target - The target of the error (for example, the name of the property in error). 7954 Target *string `json:"target,omitempty"` 7955 // Details - The error details. 7956 Details *[]ODataError `json:"details,omitempty"` 7957} 7958 7959// Operation an operation. 7960type Operation struct { 7961 // Name - The operation name. 7962 Name *string `json:"name,omitempty"` 7963 // Display - The operation display name. 7964 Display *OperationDisplay `json:"display,omitempty"` 7965 // Origin - Origin of the operation. 7966 Origin *string `json:"origin,omitempty"` 7967 // Properties - Operation properties format. 7968 Properties *MetricProperties `json:"properties,omitempty"` 7969} 7970 7971// OperationCollection a collection of Operation items. 7972type OperationCollection struct { 7973 autorest.Response `json:"-"` 7974 // Value - A collection of Operation items. 7975 Value *[]Operation `json:"value,omitempty"` 7976 // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). 7977 OdataNextLink *string `json:"@odata.nextLink,omitempty"` 7978} 7979 7980// OperationCollectionIterator provides access to a complete listing of Operation values. 7981type OperationCollectionIterator struct { 7982 i int 7983 page OperationCollectionPage 7984} 7985 7986// NextWithContext advances to the next value. If there was an error making 7987// the request the iterator does not advance and the error is returned. 7988func (iter *OperationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7989 if tracing.IsEnabled() { 7990 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionIterator.NextWithContext") 7991 defer func() { 7992 sc := -1 7993 if iter.Response().Response.Response != nil { 7994 sc = iter.Response().Response.Response.StatusCode 7995 } 7996 tracing.EndSpan(ctx, sc, err) 7997 }() 7998 } 7999 iter.i++ 8000 if iter.i < len(iter.page.Values()) { 8001 return nil 8002 } 8003 err = iter.page.NextWithContext(ctx) 8004 if err != nil { 8005 iter.i-- 8006 return err 8007 } 8008 iter.i = 0 8009 return nil 8010} 8011 8012// Next advances to the next value. If there was an error making 8013// the request the iterator does not advance and the error is returned. 8014// Deprecated: Use NextWithContext() instead. 8015func (iter *OperationCollectionIterator) Next() error { 8016 return iter.NextWithContext(context.Background()) 8017} 8018 8019// NotDone returns true if the enumeration should be started or is not yet complete. 8020func (iter OperationCollectionIterator) NotDone() bool { 8021 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8022} 8023 8024// Response returns the raw server response from the last page request. 8025func (iter OperationCollectionIterator) Response() OperationCollection { 8026 return iter.page.Response() 8027} 8028 8029// Value returns the current value or a zero-initialized value if the 8030// iterator has advanced beyond the end of the collection. 8031func (iter OperationCollectionIterator) Value() Operation { 8032 if !iter.page.NotDone() { 8033 return Operation{} 8034 } 8035 return iter.page.Values()[iter.i] 8036} 8037 8038// Creates a new instance of the OperationCollectionIterator type. 8039func NewOperationCollectionIterator(page OperationCollectionPage) OperationCollectionIterator { 8040 return OperationCollectionIterator{page: page} 8041} 8042 8043// IsEmpty returns true if the ListResult contains no values. 8044func (oc OperationCollection) IsEmpty() bool { 8045 return oc.Value == nil || len(*oc.Value) == 0 8046} 8047 8048// operationCollectionPreparer prepares a request to retrieve the next set of results. 8049// It returns nil if no more results exist. 8050func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) { 8051 if oc.OdataNextLink == nil || len(to.String(oc.OdataNextLink)) < 1 { 8052 return nil, nil 8053 } 8054 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8055 autorest.AsJSON(), 8056 autorest.AsGet(), 8057 autorest.WithBaseURL(to.String(oc.OdataNextLink))) 8058} 8059 8060// OperationCollectionPage contains a page of Operation values. 8061type OperationCollectionPage struct { 8062 fn func(context.Context, OperationCollection) (OperationCollection, error) 8063 oc OperationCollection 8064} 8065 8066// NextWithContext advances to the next page of values. If there was an error making 8067// the request the page does not advance and the error is returned. 8068func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err error) { 8069 if tracing.IsEnabled() { 8070 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionPage.NextWithContext") 8071 defer func() { 8072 sc := -1 8073 if page.Response().Response.Response != nil { 8074 sc = page.Response().Response.Response.StatusCode 8075 } 8076 tracing.EndSpan(ctx, sc, err) 8077 }() 8078 } 8079 next, err := page.fn(ctx, page.oc) 8080 if err != nil { 8081 return err 8082 } 8083 page.oc = next 8084 return nil 8085} 8086 8087// Next advances to the next page of values. If there was an error making 8088// the request the page does not advance and the error is returned. 8089// Deprecated: Use NextWithContext() instead. 8090func (page *OperationCollectionPage) Next() error { 8091 return page.NextWithContext(context.Background()) 8092} 8093 8094// NotDone returns true if the page enumeration should be started or is not yet complete. 8095func (page OperationCollectionPage) NotDone() bool { 8096 return !page.oc.IsEmpty() 8097} 8098 8099// Response returns the raw server response from the last page request. 8100func (page OperationCollectionPage) Response() OperationCollection { 8101 return page.oc 8102} 8103 8104// Values returns the slice of values for the current page or nil if there are no values. 8105func (page OperationCollectionPage) Values() []Operation { 8106 if page.oc.IsEmpty() { 8107 return nil 8108 } 8109 return *page.oc.Value 8110} 8111 8112// Creates a new instance of the OperationCollectionPage type. 8113func NewOperationCollectionPage(getNextPage func(context.Context, OperationCollection) (OperationCollection, error)) OperationCollectionPage { 8114 return OperationCollectionPage{fn: getNextPage} 8115} 8116 8117// OperationDisplay operation details. 8118type OperationDisplay struct { 8119 // Provider - The service provider. 8120 Provider *string `json:"provider,omitempty"` 8121 // Resource - Resource on which the operation is performed. 8122 Resource *string `json:"resource,omitempty"` 8123 // Operation - The operation type. 8124 Operation *string `json:"operation,omitempty"` 8125 // Description - The operation description. 8126 Description *string `json:"description,omitempty"` 8127} 8128 8129// OutputFile represents an output file produced. 8130type OutputFile struct { 8131 // Labels - The list of labels that describe how the encoder should multiplex video and audio into an output file. For example, if the encoder is producing two video layers with labels v1 and v2, and one audio layer with label a1, then an array like '[v1, a1]' tells the encoder to produce an output file with the video track represented by v1 and the audio track represented by a1. 8132 Labels *[]string `json:"labels,omitempty"` 8133} 8134 8135// BasicOverlay base type for all overlays - image, audio or video. 8136type BasicOverlay interface { 8137 AsAudioOverlay() (*AudioOverlay, bool) 8138 AsVideoOverlay() (*VideoOverlay, bool) 8139 AsOverlay() (*Overlay, bool) 8140} 8141 8142// Overlay base type for all overlays - image, audio or video. 8143type Overlay struct { 8144 // InputLabel - The label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG or PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats. 8145 InputLabel *string `json:"inputLabel,omitempty"` 8146 // Start - The start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds in to the input video. If not specified the overlay starts from the beginning of the input video. 8147 Start *string `json:"start,omitempty"` 8148 // End - The position in the input video at which the overlay ends. The value should be in ISO 8601 duration format. For example, PT30S to end the overlay at 30 seconds in to the input video. If not specified the overlay will be applied until the end of the input video if inputLoop is true. Else, if inputLoop is false, then overlay will last as long as the duration of the overlay media. 8149 End *string `json:"end,omitempty"` 8150 // FadeInDuration - The duration over which the overlay fades in onto the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade in (same as PT0S). 8151 FadeInDuration *string `json:"fadeInDuration,omitempty"` 8152 // FadeOutDuration - The duration over which the overlay fades out of the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade out (same as PT0S). 8153 FadeOutDuration *string `json:"fadeOutDuration,omitempty"` 8154 // AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0. 8155 AudioGainLevel *float64 `json:"audioGainLevel,omitempty"` 8156 // OdataType - Possible values include: 'OdataTypeOverlay', 'OdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeMicrosoftMediaVideoOverlay' 8157 OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"` 8158} 8159 8160func unmarshalBasicOverlay(body []byte) (BasicOverlay, error) { 8161 var m map[string]interface{} 8162 err := json.Unmarshal(body, &m) 8163 if err != nil { 8164 return nil, err 8165 } 8166 8167 switch m["@odata.type"] { 8168 case string(OdataTypeMicrosoftMediaAudioOverlay): 8169 var ao AudioOverlay 8170 err := json.Unmarshal(body, &ao) 8171 return ao, err 8172 case string(OdataTypeMicrosoftMediaVideoOverlay): 8173 var vo VideoOverlay 8174 err := json.Unmarshal(body, &vo) 8175 return vo, err 8176 default: 8177 var o Overlay 8178 err := json.Unmarshal(body, &o) 8179 return o, err 8180 } 8181} 8182func unmarshalBasicOverlayArray(body []byte) ([]BasicOverlay, error) { 8183 var rawMessages []*json.RawMessage 8184 err := json.Unmarshal(body, &rawMessages) 8185 if err != nil { 8186 return nil, err 8187 } 8188 8189 oArray := make([]BasicOverlay, len(rawMessages)) 8190 8191 for index, rawMessage := range rawMessages { 8192 o, err := unmarshalBasicOverlay(*rawMessage) 8193 if err != nil { 8194 return nil, err 8195 } 8196 oArray[index] = o 8197 } 8198 return oArray, nil 8199} 8200 8201// MarshalJSON is the custom marshaler for Overlay. 8202func (o Overlay) MarshalJSON() ([]byte, error) { 8203 o.OdataType = OdataTypeOverlay 8204 objectMap := make(map[string]interface{}) 8205 if o.InputLabel != nil { 8206 objectMap["inputLabel"] = o.InputLabel 8207 } 8208 if o.Start != nil { 8209 objectMap["start"] = o.Start 8210 } 8211 if o.End != nil { 8212 objectMap["end"] = o.End 8213 } 8214 if o.FadeInDuration != nil { 8215 objectMap["fadeInDuration"] = o.FadeInDuration 8216 } 8217 if o.FadeOutDuration != nil { 8218 objectMap["fadeOutDuration"] = o.FadeOutDuration 8219 } 8220 if o.AudioGainLevel != nil { 8221 objectMap["audioGainLevel"] = o.AudioGainLevel 8222 } 8223 if o.OdataType != "" { 8224 objectMap["@odata.type"] = o.OdataType 8225 } 8226 return json.Marshal(objectMap) 8227} 8228 8229// AsAudioOverlay is the BasicOverlay implementation for Overlay. 8230func (o Overlay) AsAudioOverlay() (*AudioOverlay, bool) { 8231 return nil, false 8232} 8233 8234// AsVideoOverlay is the BasicOverlay implementation for Overlay. 8235func (o Overlay) AsVideoOverlay() (*VideoOverlay, bool) { 8236 return nil, false 8237} 8238 8239// AsOverlay is the BasicOverlay implementation for Overlay. 8240func (o Overlay) AsOverlay() (*Overlay, bool) { 8241 return &o, true 8242} 8243 8244// AsBasicOverlay is the BasicOverlay implementation for Overlay. 8245func (o Overlay) AsBasicOverlay() (BasicOverlay, bool) { 8246 return &o, true 8247} 8248 8249// PngFormat describes the settings for producing PNG thumbnails. 8250type PngFormat struct { 8251 // FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. 8252 FilenamePattern *string `json:"filenamePattern,omitempty"` 8253 // OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat' 8254 OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"` 8255} 8256 8257// MarshalJSON is the custom marshaler for PngFormat. 8258func (pf PngFormat) MarshalJSON() ([]byte, error) { 8259 pf.OdataType = OdataTypeMicrosoftMediaPngFormat 8260 objectMap := make(map[string]interface{}) 8261 if pf.FilenamePattern != nil { 8262 objectMap["filenamePattern"] = pf.FilenamePattern 8263 } 8264 if pf.OdataType != "" { 8265 objectMap["@odata.type"] = pf.OdataType 8266 } 8267 return json.Marshal(objectMap) 8268} 8269 8270// AsImageFormat is the BasicFormat implementation for PngFormat. 8271func (pf PngFormat) AsImageFormat() (*ImageFormat, bool) { 8272 return nil, false 8273} 8274 8275// AsBasicImageFormat is the BasicFormat implementation for PngFormat. 8276func (pf PngFormat) AsBasicImageFormat() (BasicImageFormat, bool) { 8277 return &pf, true 8278} 8279 8280// AsJpgFormat is the BasicFormat implementation for PngFormat. 8281func (pf PngFormat) AsJpgFormat() (*JpgFormat, bool) { 8282 return nil, false 8283} 8284 8285// AsPngFormat is the BasicFormat implementation for PngFormat. 8286func (pf PngFormat) AsPngFormat() (*PngFormat, bool) { 8287 return &pf, true 8288} 8289 8290// AsMultiBitrateFormat is the BasicFormat implementation for PngFormat. 8291func (pf PngFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) { 8292 return nil, false 8293} 8294 8295// AsBasicMultiBitrateFormat is the BasicFormat implementation for PngFormat. 8296func (pf PngFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) { 8297 return nil, false 8298} 8299 8300// AsMp4Format is the BasicFormat implementation for PngFormat. 8301func (pf PngFormat) AsMp4Format() (*Mp4Format, bool) { 8302 return nil, false 8303} 8304 8305// AsTransportStreamFormat is the BasicFormat implementation for PngFormat. 8306func (pf PngFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) { 8307 return nil, false 8308} 8309 8310// AsFormat is the BasicFormat implementation for PngFormat. 8311func (pf PngFormat) AsFormat() (*Format, bool) { 8312 return nil, false 8313} 8314 8315// AsBasicFormat is the BasicFormat implementation for PngFormat. 8316func (pf PngFormat) AsBasicFormat() (BasicFormat, bool) { 8317 return &pf, true 8318} 8319 8320// PngImage describes the properties for producing a series of PNG images from the input video. 8321type PngImage struct { 8322 // Layers - A collection of output PNG image layers to be produced by the encoder. 8323 Layers *[]PngLayer `json:"layers,omitempty"` 8324 // Start - The position in the input video from where to start generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT05S), or a frame count (For example, 10 for the 10th frame), or a relative value (For example, 1%). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video. 8325 Start *string `json:"start,omitempty"` 8326 // Step - The intervals at which thumbnails are generated. The value can be in absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), or a frame count (For example, 30 for every 30 frames), or a relative value (For example, 1%). 8327 Step *string `json:"step,omitempty"` 8328 // Range - The position in the input video at which to stop generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop at the 300th frame), or a relative value (For example, 100%). 8329 Range *string `json:"range,omitempty"` 8330 // KeyFrameInterval - The distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). 8331 KeyFrameInterval *string `json:"keyFrameInterval,omitempty"` 8332 // StretchMode - The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit' 8333 StretchMode StretchMode `json:"stretchMode,omitempty"` 8334 // Label - An optional label for the codec. The label can be used to control muxing behavior. 8335 Label *string `json:"label,omitempty"` 8336 // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' 8337 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` 8338} 8339 8340// MarshalJSON is the custom marshaler for PngImage. 8341func (pi PngImage) MarshalJSON() ([]byte, error) { 8342 pi.OdataType = OdataTypeMicrosoftMediaPngImage 8343 objectMap := make(map[string]interface{}) 8344 if pi.Layers != nil { 8345 objectMap["layers"] = pi.Layers 8346 } 8347 if pi.Start != nil { 8348 objectMap["start"] = pi.Start 8349 } 8350 if pi.Step != nil { 8351 objectMap["step"] = pi.Step 8352 } 8353 if pi.Range != nil { 8354 objectMap["range"] = pi.Range 8355 } 8356 if pi.KeyFrameInterval != nil { 8357 objectMap["keyFrameInterval"] = pi.KeyFrameInterval 8358 } 8359 if pi.StretchMode != "" { 8360 objectMap["stretchMode"] = pi.StretchMode 8361 } 8362 if pi.Label != nil { 8363 objectMap["label"] = pi.Label 8364 } 8365 if pi.OdataType != "" { 8366 objectMap["@odata.type"] = pi.OdataType 8367 } 8368 return json.Marshal(objectMap) 8369} 8370 8371// AsAudio is the BasicCodec implementation for PngImage. 8372func (pi PngImage) AsAudio() (*Audio, bool) { 8373 return nil, false 8374} 8375 8376// AsBasicAudio is the BasicCodec implementation for PngImage. 8377func (pi PngImage) AsBasicAudio() (BasicAudio, bool) { 8378 return nil, false 8379} 8380 8381// AsAacAudio is the BasicCodec implementation for PngImage. 8382func (pi PngImage) AsAacAudio() (*AacAudio, bool) { 8383 return nil, false 8384} 8385 8386// AsCopyVideo is the BasicCodec implementation for PngImage. 8387func (pi PngImage) AsCopyVideo() (*CopyVideo, bool) { 8388 return nil, false 8389} 8390 8391// AsVideo is the BasicCodec implementation for PngImage. 8392func (pi PngImage) AsVideo() (*Video, bool) { 8393 return nil, false 8394} 8395 8396// AsBasicVideo is the BasicCodec implementation for PngImage. 8397func (pi PngImage) AsBasicVideo() (BasicVideo, bool) { 8398 return &pi, true 8399} 8400 8401// AsImage is the BasicCodec implementation for PngImage. 8402func (pi PngImage) AsImage() (*Image, bool) { 8403 return nil, false 8404} 8405 8406// AsBasicImage is the BasicCodec implementation for PngImage. 8407func (pi PngImage) AsBasicImage() (BasicImage, bool) { 8408 return &pi, true 8409} 8410 8411// AsCopyAudio is the BasicCodec implementation for PngImage. 8412func (pi PngImage) AsCopyAudio() (*CopyAudio, bool) { 8413 return nil, false 8414} 8415 8416// AsH264Video is the BasicCodec implementation for PngImage. 8417func (pi PngImage) AsH264Video() (*H264Video, bool) { 8418 return nil, false 8419} 8420 8421// AsJpgImage is the BasicCodec implementation for PngImage. 8422func (pi PngImage) AsJpgImage() (*JpgImage, bool) { 8423 return nil, false 8424} 8425 8426// AsPngImage is the BasicCodec implementation for PngImage. 8427func (pi PngImage) AsPngImage() (*PngImage, bool) { 8428 return &pi, true 8429} 8430 8431// AsCodec is the BasicCodec implementation for PngImage. 8432func (pi PngImage) AsCodec() (*Codec, bool) { 8433 return nil, false 8434} 8435 8436// AsBasicCodec is the BasicCodec implementation for PngImage. 8437func (pi PngImage) AsBasicCodec() (BasicCodec, bool) { 8438 return &pi, true 8439} 8440 8441// PngLayer describes the settings to produce a PNG image from the input video. 8442type PngLayer struct { 8443 // Width - The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. 8444 Width *string `json:"width,omitempty"` 8445 // Height - The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. 8446 Height *string `json:"height,omitempty"` 8447 // Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file. 8448 Label *string `json:"label,omitempty"` 8449 // OdataType - Possible values include: 'OdataTypeLayer', 'OdataTypeMicrosoftMediaVideoLayer', 'OdataTypeMicrosoftMediaH264Layer', 'OdataTypeMicrosoftMediaJpgLayer', 'OdataTypeMicrosoftMediaPngLayer' 8450 OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"` 8451} 8452 8453// MarshalJSON is the custom marshaler for PngLayer. 8454func (pl PngLayer) MarshalJSON() ([]byte, error) { 8455 pl.OdataType = OdataTypeMicrosoftMediaPngLayer 8456 objectMap := make(map[string]interface{}) 8457 if pl.Width != nil { 8458 objectMap["width"] = pl.Width 8459 } 8460 if pl.Height != nil { 8461 objectMap["height"] = pl.Height 8462 } 8463 if pl.Label != nil { 8464 objectMap["label"] = pl.Label 8465 } 8466 if pl.OdataType != "" { 8467 objectMap["@odata.type"] = pl.OdataType 8468 } 8469 return json.Marshal(objectMap) 8470} 8471 8472// AsVideoLayer is the BasicLayer implementation for PngLayer. 8473func (pl PngLayer) AsVideoLayer() (*VideoLayer, bool) { 8474 return nil, false 8475} 8476 8477// AsBasicVideoLayer is the BasicLayer implementation for PngLayer. 8478func (pl PngLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) { 8479 return nil, false 8480} 8481 8482// AsH264Layer is the BasicLayer implementation for PngLayer. 8483func (pl PngLayer) AsH264Layer() (*H264Layer, bool) { 8484 return nil, false 8485} 8486 8487// AsJpgLayer is the BasicLayer implementation for PngLayer. 8488func (pl PngLayer) AsJpgLayer() (*JpgLayer, bool) { 8489 return nil, false 8490} 8491 8492// AsPngLayer is the BasicLayer implementation for PngLayer. 8493func (pl PngLayer) AsPngLayer() (*PngLayer, bool) { 8494 return &pl, true 8495} 8496 8497// AsLayer is the BasicLayer implementation for PngLayer. 8498func (pl PngLayer) AsLayer() (*Layer, bool) { 8499 return nil, false 8500} 8501 8502// AsBasicLayer is the BasicLayer implementation for PngLayer. 8503func (pl PngLayer) AsBasicLayer() (BasicLayer, bool) { 8504 return &pl, true 8505} 8506 8507// PresentationTimeRange the presentation time range, this is asset related and not recommended for Account 8508// Filter. 8509type PresentationTimeRange struct { 8510 // StartTimestamp - The absolute start time boundary. 8511 StartTimestamp *int64 `json:"startTimestamp,omitempty"` 8512 // EndTimestamp - The absolute end time boundary. 8513 EndTimestamp *int64 `json:"endTimestamp,omitempty"` 8514 // PresentationWindowDuration - The relative to end sliding window. 8515 PresentationWindowDuration *int64 `json:"presentationWindowDuration,omitempty"` 8516 // LiveBackoffDuration - The relative to end right edge. 8517 LiveBackoffDuration *int64 `json:"liveBackoffDuration,omitempty"` 8518 // Timescale - The time scale of time stamps. 8519 Timescale *int64 `json:"timescale,omitempty"` 8520 // ForceEndTimestamp - The indicator of forcing existing of end time stamp. 8521 ForceEndTimestamp *bool `json:"forceEndTimestamp,omitempty"` 8522} 8523 8524// BasicPreset base type for all Presets, which define the recipe or instructions on how the input media files should 8525// be processed. 8526type BasicPreset interface { 8527 AsFaceDetectorPreset() (*FaceDetectorPreset, bool) 8528 AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) 8529 AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) 8530 AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) 8531 AsStandardEncoderPreset() (*StandardEncoderPreset, bool) 8532 AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) 8533 AsPreset() (*Preset, bool) 8534} 8535 8536// Preset base type for all Presets, which define the recipe or instructions on how the input media files 8537// should be processed. 8538type Preset struct { 8539 // OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset' 8540 OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"` 8541} 8542 8543func unmarshalBasicPreset(body []byte) (BasicPreset, error) { 8544 var m map[string]interface{} 8545 err := json.Unmarshal(body, &m) 8546 if err != nil { 8547 return nil, err 8548 } 8549 8550 switch m["@odata.type"] { 8551 case string(OdataTypeMicrosoftMediaFaceDetectorPreset): 8552 var fdp FaceDetectorPreset 8553 err := json.Unmarshal(body, &fdp) 8554 return fdp, err 8555 case string(OdataTypeMicrosoftMediaAudioAnalyzerPreset): 8556 var aap AudioAnalyzerPreset 8557 err := json.Unmarshal(body, &aap) 8558 return aap, err 8559 case string(OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset): 8560 var bisep BuiltInStandardEncoderPreset 8561 err := json.Unmarshal(body, &bisep) 8562 return bisep, err 8563 case string(OdataTypeMicrosoftMediaStandardEncoderPreset): 8564 var sep StandardEncoderPreset 8565 err := json.Unmarshal(body, &sep) 8566 return sep, err 8567 case string(OdataTypeMicrosoftMediaVideoAnalyzerPreset): 8568 var vap VideoAnalyzerPreset 8569 err := json.Unmarshal(body, &vap) 8570 return vap, err 8571 default: 8572 var p Preset 8573 err := json.Unmarshal(body, &p) 8574 return p, err 8575 } 8576} 8577func unmarshalBasicPresetArray(body []byte) ([]BasicPreset, error) { 8578 var rawMessages []*json.RawMessage 8579 err := json.Unmarshal(body, &rawMessages) 8580 if err != nil { 8581 return nil, err 8582 } 8583 8584 pArray := make([]BasicPreset, len(rawMessages)) 8585 8586 for index, rawMessage := range rawMessages { 8587 p, err := unmarshalBasicPreset(*rawMessage) 8588 if err != nil { 8589 return nil, err 8590 } 8591 pArray[index] = p 8592 } 8593 return pArray, nil 8594} 8595 8596// MarshalJSON is the custom marshaler for Preset. 8597func (p Preset) MarshalJSON() ([]byte, error) { 8598 p.OdataType = OdataTypePreset 8599 objectMap := make(map[string]interface{}) 8600 if p.OdataType != "" { 8601 objectMap["@odata.type"] = p.OdataType 8602 } 8603 return json.Marshal(objectMap) 8604} 8605 8606// AsFaceDetectorPreset is the BasicPreset implementation for Preset. 8607func (p Preset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) { 8608 return nil, false 8609} 8610 8611// AsAudioAnalyzerPreset is the BasicPreset implementation for Preset. 8612func (p Preset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) { 8613 return nil, false 8614} 8615 8616// AsBasicAudioAnalyzerPreset is the BasicPreset implementation for Preset. 8617func (p Preset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) { 8618 return nil, false 8619} 8620 8621// AsBuiltInStandardEncoderPreset is the BasicPreset implementation for Preset. 8622func (p Preset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) { 8623 return nil, false 8624} 8625 8626// AsStandardEncoderPreset is the BasicPreset implementation for Preset. 8627func (p Preset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) { 8628 return nil, false 8629} 8630 8631// AsVideoAnalyzerPreset is the BasicPreset implementation for Preset. 8632func (p Preset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) { 8633 return nil, false 8634} 8635 8636// AsPreset is the BasicPreset implementation for Preset. 8637func (p Preset) AsPreset() (*Preset, bool) { 8638 return &p, true 8639} 8640 8641// AsBasicPreset is the BasicPreset implementation for Preset. 8642func (p Preset) AsBasicPreset() (BasicPreset, bool) { 8643 return &p, true 8644} 8645 8646// Provider a resource provider. 8647type Provider struct { 8648 // ProviderName - The provider name. 8649 ProviderName *string `json:"providerName,omitempty"` 8650} 8651 8652// ProxyResource the resource model definition for a ARM proxy resource. 8653type ProxyResource struct { 8654 // ID - READ-ONLY; Fully qualified resource ID for the resource. 8655 ID *string `json:"id,omitempty"` 8656 // Name - READ-ONLY; The name of the resource. 8657 Name *string `json:"name,omitempty"` 8658 // Type - READ-ONLY; The type of the resource. 8659 Type *string `json:"type,omitempty"` 8660} 8661 8662// Rectangle describes the properties of a rectangular window applied to the input media before processing 8663// it. 8664type Rectangle struct { 8665 // Left - The number of pixels from the left-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). 8666 Left *string `json:"left,omitempty"` 8667 // Top - The number of pixels from the top-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). 8668 Top *string `json:"top,omitempty"` 8669 // Width - The width of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). 8670 Width *string `json:"width,omitempty"` 8671 // Height - The height of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). 8672 Height *string `json:"height,omitempty"` 8673} 8674 8675// Resource the core properties of ARM resources. 8676type Resource struct { 8677 // ID - READ-ONLY; Fully qualified resource ID for the resource. 8678 ID *string `json:"id,omitempty"` 8679 // Name - READ-ONLY; The name of the resource. 8680 Name *string `json:"name,omitempty"` 8681 // Type - READ-ONLY; The type of the resource. 8682 Type *string `json:"type,omitempty"` 8683} 8684 8685// Service a Media Services account. 8686type Service struct { 8687 autorest.Response `json:"-"` 8688 // ServiceProperties - The resource properties. 8689 *ServiceProperties `json:"properties,omitempty"` 8690 // Tags - Resource tags. 8691 Tags map[string]*string `json:"tags"` 8692 // Location - The Azure Region of the resource. 8693 Location *string `json:"location,omitempty"` 8694 // ID - READ-ONLY; Fully qualified resource ID for the resource. 8695 ID *string `json:"id,omitempty"` 8696 // Name - READ-ONLY; The name of the resource. 8697 Name *string `json:"name,omitempty"` 8698 // Type - READ-ONLY; The type of the resource. 8699 Type *string `json:"type,omitempty"` 8700} 8701 8702// MarshalJSON is the custom marshaler for Service. 8703func (s Service) MarshalJSON() ([]byte, error) { 8704 objectMap := make(map[string]interface{}) 8705 if s.ServiceProperties != nil { 8706 objectMap["properties"] = s.ServiceProperties 8707 } 8708 if s.Tags != nil { 8709 objectMap["tags"] = s.Tags 8710 } 8711 if s.Location != nil { 8712 objectMap["location"] = s.Location 8713 } 8714 return json.Marshal(objectMap) 8715} 8716 8717// UnmarshalJSON is the custom unmarshaler for Service struct. 8718func (s *Service) UnmarshalJSON(body []byte) error { 8719 var m map[string]*json.RawMessage 8720 err := json.Unmarshal(body, &m) 8721 if err != nil { 8722 return err 8723 } 8724 for k, v := range m { 8725 switch k { 8726 case "properties": 8727 if v != nil { 8728 var serviceProperties ServiceProperties 8729 err = json.Unmarshal(*v, &serviceProperties) 8730 if err != nil { 8731 return err 8732 } 8733 s.ServiceProperties = &serviceProperties 8734 } 8735 case "tags": 8736 if v != nil { 8737 var tags map[string]*string 8738 err = json.Unmarshal(*v, &tags) 8739 if err != nil { 8740 return err 8741 } 8742 s.Tags = tags 8743 } 8744 case "location": 8745 if v != nil { 8746 var location string 8747 err = json.Unmarshal(*v, &location) 8748 if err != nil { 8749 return err 8750 } 8751 s.Location = &location 8752 } 8753 case "id": 8754 if v != nil { 8755 var ID string 8756 err = json.Unmarshal(*v, &ID) 8757 if err != nil { 8758 return err 8759 } 8760 s.ID = &ID 8761 } 8762 case "name": 8763 if v != nil { 8764 var name string 8765 err = json.Unmarshal(*v, &name) 8766 if err != nil { 8767 return err 8768 } 8769 s.Name = &name 8770 } 8771 case "type": 8772 if v != nil { 8773 var typeVar string 8774 err = json.Unmarshal(*v, &typeVar) 8775 if err != nil { 8776 return err 8777 } 8778 s.Type = &typeVar 8779 } 8780 } 8781 } 8782 8783 return nil 8784} 8785 8786// ServiceCollection a collection of MediaService items. 8787type ServiceCollection struct { 8788 autorest.Response `json:"-"` 8789 // Value - A collection of MediaService items. 8790 Value *[]Service `json:"value,omitempty"` 8791 // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). 8792 OdataNextLink *string `json:"@odata.nextLink,omitempty"` 8793} 8794 8795// ServiceCollectionIterator provides access to a complete listing of Service values. 8796type ServiceCollectionIterator struct { 8797 i int 8798 page ServiceCollectionPage 8799} 8800 8801// NextWithContext advances to the next value. If there was an error making 8802// the request the iterator does not advance and the error is returned. 8803func (iter *ServiceCollectionIterator) NextWithContext(ctx context.Context) (err error) { 8804 if tracing.IsEnabled() { 8805 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceCollectionIterator.NextWithContext") 8806 defer func() { 8807 sc := -1 8808 if iter.Response().Response.Response != nil { 8809 sc = iter.Response().Response.Response.StatusCode 8810 } 8811 tracing.EndSpan(ctx, sc, err) 8812 }() 8813 } 8814 iter.i++ 8815 if iter.i < len(iter.page.Values()) { 8816 return nil 8817 } 8818 err = iter.page.NextWithContext(ctx) 8819 if err != nil { 8820 iter.i-- 8821 return err 8822 } 8823 iter.i = 0 8824 return nil 8825} 8826 8827// Next advances to the next value. If there was an error making 8828// the request the iterator does not advance and the error is returned. 8829// Deprecated: Use NextWithContext() instead. 8830func (iter *ServiceCollectionIterator) Next() error { 8831 return iter.NextWithContext(context.Background()) 8832} 8833 8834// NotDone returns true if the enumeration should be started or is not yet complete. 8835func (iter ServiceCollectionIterator) NotDone() bool { 8836 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8837} 8838 8839// Response returns the raw server response from the last page request. 8840func (iter ServiceCollectionIterator) Response() ServiceCollection { 8841 return iter.page.Response() 8842} 8843 8844// Value returns the current value or a zero-initialized value if the 8845// iterator has advanced beyond the end of the collection. 8846func (iter ServiceCollectionIterator) Value() Service { 8847 if !iter.page.NotDone() { 8848 return Service{} 8849 } 8850 return iter.page.Values()[iter.i] 8851} 8852 8853// Creates a new instance of the ServiceCollectionIterator type. 8854func NewServiceCollectionIterator(page ServiceCollectionPage) ServiceCollectionIterator { 8855 return ServiceCollectionIterator{page: page} 8856} 8857 8858// IsEmpty returns true if the ListResult contains no values. 8859func (sc ServiceCollection) IsEmpty() bool { 8860 return sc.Value == nil || len(*sc.Value) == 0 8861} 8862 8863// serviceCollectionPreparer prepares a request to retrieve the next set of results. 8864// It returns nil if no more results exist. 8865func (sc ServiceCollection) serviceCollectionPreparer(ctx context.Context) (*http.Request, error) { 8866 if sc.OdataNextLink == nil || len(to.String(sc.OdataNextLink)) < 1 { 8867 return nil, nil 8868 } 8869 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8870 autorest.AsJSON(), 8871 autorest.AsGet(), 8872 autorest.WithBaseURL(to.String(sc.OdataNextLink))) 8873} 8874 8875// ServiceCollectionPage contains a page of Service values. 8876type ServiceCollectionPage struct { 8877 fn func(context.Context, ServiceCollection) (ServiceCollection, error) 8878 sc ServiceCollection 8879} 8880 8881// NextWithContext advances to the next page of values. If there was an error making 8882// the request the page does not advance and the error is returned. 8883func (page *ServiceCollectionPage) NextWithContext(ctx context.Context) (err error) { 8884 if tracing.IsEnabled() { 8885 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceCollectionPage.NextWithContext") 8886 defer func() { 8887 sc := -1 8888 if page.Response().Response.Response != nil { 8889 sc = page.Response().Response.Response.StatusCode 8890 } 8891 tracing.EndSpan(ctx, sc, err) 8892 }() 8893 } 8894 next, err := page.fn(ctx, page.sc) 8895 if err != nil { 8896 return err 8897 } 8898 page.sc = next 8899 return nil 8900} 8901 8902// Next advances to the next page of values. If there was an error making 8903// the request the page does not advance and the error is returned. 8904// Deprecated: Use NextWithContext() instead. 8905func (page *ServiceCollectionPage) Next() error { 8906 return page.NextWithContext(context.Background()) 8907} 8908 8909// NotDone returns true if the page enumeration should be started or is not yet complete. 8910func (page ServiceCollectionPage) NotDone() bool { 8911 return !page.sc.IsEmpty() 8912} 8913 8914// Response returns the raw server response from the last page request. 8915func (page ServiceCollectionPage) Response() ServiceCollection { 8916 return page.sc 8917} 8918 8919// Values returns the slice of values for the current page or nil if there are no values. 8920func (page ServiceCollectionPage) Values() []Service { 8921 if page.sc.IsEmpty() { 8922 return nil 8923 } 8924 return *page.sc.Value 8925} 8926 8927// Creates a new instance of the ServiceCollectionPage type. 8928func NewServiceCollectionPage(getNextPage func(context.Context, ServiceCollection) (ServiceCollection, error)) ServiceCollectionPage { 8929 return ServiceCollectionPage{fn: getNextPage} 8930} 8931 8932// ServiceProperties properties of the Media Services account. 8933type ServiceProperties struct { 8934 // MediaServiceID - READ-ONLY; The Media Services account ID. 8935 MediaServiceID *uuid.UUID `json:"mediaServiceId,omitempty"` 8936 // StorageAccounts - The storage accounts for this resource. 8937 StorageAccounts *[]StorageAccount `json:"storageAccounts,omitempty"` 8938} 8939 8940// ServiceSpecification the service metric specifications. 8941type ServiceSpecification struct { 8942 // MetricSpecifications - READ-ONLY; List of metric specifications. 8943 MetricSpecifications *[]Metric `json:"metricSpecifications,omitempty"` 8944} 8945 8946// StandardEncoderPreset describes all the settings to be used when encoding the input video with the 8947// Standard Encoder. 8948type StandardEncoderPreset struct { 8949 // Filters - One or more filtering operations that are applied to the input media before encoding. 8950 Filters *Filters `json:"filters,omitempty"` 8951 // Codecs - The list of codecs to be used when encoding the input video. 8952 Codecs *[]BasicCodec `json:"codecs,omitempty"` 8953 // Formats - The list of outputs to be produced by the encoder. 8954 Formats *[]BasicFormat `json:"formats,omitempty"` 8955 // OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset' 8956 OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"` 8957} 8958 8959// MarshalJSON is the custom marshaler for StandardEncoderPreset. 8960func (sep StandardEncoderPreset) MarshalJSON() ([]byte, error) { 8961 sep.OdataType = OdataTypeMicrosoftMediaStandardEncoderPreset 8962 objectMap := make(map[string]interface{}) 8963 if sep.Filters != nil { 8964 objectMap["filters"] = sep.Filters 8965 } 8966 if sep.Codecs != nil { 8967 objectMap["codecs"] = sep.Codecs 8968 } 8969 if sep.Formats != nil { 8970 objectMap["formats"] = sep.Formats 8971 } 8972 if sep.OdataType != "" { 8973 objectMap["@odata.type"] = sep.OdataType 8974 } 8975 return json.Marshal(objectMap) 8976} 8977 8978// AsFaceDetectorPreset is the BasicPreset implementation for StandardEncoderPreset. 8979func (sep StandardEncoderPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) { 8980 return nil, false 8981} 8982 8983// AsAudioAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset. 8984func (sep StandardEncoderPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) { 8985 return nil, false 8986} 8987 8988// AsBasicAudioAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset. 8989func (sep StandardEncoderPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) { 8990 return nil, false 8991} 8992 8993// AsBuiltInStandardEncoderPreset is the BasicPreset implementation for StandardEncoderPreset. 8994func (sep StandardEncoderPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) { 8995 return nil, false 8996} 8997 8998// AsStandardEncoderPreset is the BasicPreset implementation for StandardEncoderPreset. 8999func (sep StandardEncoderPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) { 9000 return &sep, true 9001} 9002 9003// AsVideoAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset. 9004func (sep StandardEncoderPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) { 9005 return nil, false 9006} 9007 9008// AsPreset is the BasicPreset implementation for StandardEncoderPreset. 9009func (sep StandardEncoderPreset) AsPreset() (*Preset, bool) { 9010 return nil, false 9011} 9012 9013// AsBasicPreset is the BasicPreset implementation for StandardEncoderPreset. 9014func (sep StandardEncoderPreset) AsBasicPreset() (BasicPreset, bool) { 9015 return &sep, true 9016} 9017 9018// UnmarshalJSON is the custom unmarshaler for StandardEncoderPreset struct. 9019func (sep *StandardEncoderPreset) UnmarshalJSON(body []byte) error { 9020 var m map[string]*json.RawMessage 9021 err := json.Unmarshal(body, &m) 9022 if err != nil { 9023 return err 9024 } 9025 for k, v := range m { 9026 switch k { 9027 case "filters": 9028 if v != nil { 9029 var filters Filters 9030 err = json.Unmarshal(*v, &filters) 9031 if err != nil { 9032 return err 9033 } 9034 sep.Filters = &filters 9035 } 9036 case "codecs": 9037 if v != nil { 9038 codecs, err := unmarshalBasicCodecArray(*v) 9039 if err != nil { 9040 return err 9041 } 9042 sep.Codecs = &codecs 9043 } 9044 case "formats": 9045 if v != nil { 9046 formats, err := unmarshalBasicFormatArray(*v) 9047 if err != nil { 9048 return err 9049 } 9050 sep.Formats = &formats 9051 } 9052 case "@odata.type": 9053 if v != nil { 9054 var odataType OdataTypeBasicPreset 9055 err = json.Unmarshal(*v, &odataType) 9056 if err != nil { 9057 return err 9058 } 9059 sep.OdataType = odataType 9060 } 9061 } 9062 } 9063 9064 return nil 9065} 9066 9067// StorageAccount the storage account details. 9068type StorageAccount struct { 9069 // ID - The ID of the storage account resource. Media Services relies on tables and queues as well as blobs, so the primary storage account must be a Standard Storage account (either Microsoft.ClassicStorage or Microsoft.Storage). Blob only storage accounts can be added as secondary storage accounts. 9070 ID *string `json:"id,omitempty"` 9071 // Type - The type of the storage account. Possible values include: 'Primary', 'Secondary' 9072 Type StorageAccountType `json:"type,omitempty"` 9073} 9074 9075// StorageEncryptedAssetDecryptionData data needed to decrypt asset files encrypted with legacy storage 9076// encryption. 9077type StorageEncryptedAssetDecryptionData struct { 9078 autorest.Response `json:"-"` 9079 // Key - The Asset File storage encryption key. 9080 Key *[]byte `json:"key,omitempty"` 9081 // AssetFileEncryptionMetadata - Asset File encryption metadata. 9082 AssetFileEncryptionMetadata *[]AssetFileEncryptionMetadata `json:"assetFileEncryptionMetadata,omitempty"` 9083} 9084 9085// StreamingEndpoint the StreamingEndpoint. 9086type StreamingEndpoint struct { 9087 autorest.Response `json:"-"` 9088 // StreamingEndpointProperties - The StreamingEndpoint properties. 9089 *StreamingEndpointProperties `json:"properties,omitempty"` 9090 // Tags - Resource tags. 9091 Tags map[string]*string `json:"tags"` 9092 // Location - The Azure Region of the resource. 9093 Location *string `json:"location,omitempty"` 9094 // ID - READ-ONLY; Fully qualified resource ID for the resource. 9095 ID *string `json:"id,omitempty"` 9096 // Name - READ-ONLY; The name of the resource. 9097 Name *string `json:"name,omitempty"` 9098 // Type - READ-ONLY; The type of the resource. 9099 Type *string `json:"type,omitempty"` 9100} 9101 9102// MarshalJSON is the custom marshaler for StreamingEndpoint. 9103func (se StreamingEndpoint) MarshalJSON() ([]byte, error) { 9104 objectMap := make(map[string]interface{}) 9105 if se.StreamingEndpointProperties != nil { 9106 objectMap["properties"] = se.StreamingEndpointProperties 9107 } 9108 if se.Tags != nil { 9109 objectMap["tags"] = se.Tags 9110 } 9111 if se.Location != nil { 9112 objectMap["location"] = se.Location 9113 } 9114 return json.Marshal(objectMap) 9115} 9116 9117// UnmarshalJSON is the custom unmarshaler for StreamingEndpoint struct. 9118func (se *StreamingEndpoint) UnmarshalJSON(body []byte) error { 9119 var m map[string]*json.RawMessage 9120 err := json.Unmarshal(body, &m) 9121 if err != nil { 9122 return err 9123 } 9124 for k, v := range m { 9125 switch k { 9126 case "properties": 9127 if v != nil { 9128 var streamingEndpointProperties StreamingEndpointProperties 9129 err = json.Unmarshal(*v, &streamingEndpointProperties) 9130 if err != nil { 9131 return err 9132 } 9133 se.StreamingEndpointProperties = &streamingEndpointProperties 9134 } 9135 case "tags": 9136 if v != nil { 9137 var tags map[string]*string 9138 err = json.Unmarshal(*v, &tags) 9139 if err != nil { 9140 return err 9141 } 9142 se.Tags = tags 9143 } 9144 case "location": 9145 if v != nil { 9146 var location string 9147 err = json.Unmarshal(*v, &location) 9148 if err != nil { 9149 return err 9150 } 9151 se.Location = &location 9152 } 9153 case "id": 9154 if v != nil { 9155 var ID string 9156 err = json.Unmarshal(*v, &ID) 9157 if err != nil { 9158 return err 9159 } 9160 se.ID = &ID 9161 } 9162 case "name": 9163 if v != nil { 9164 var name string 9165 err = json.Unmarshal(*v, &name) 9166 if err != nil { 9167 return err 9168 } 9169 se.Name = &name 9170 } 9171 case "type": 9172 if v != nil { 9173 var typeVar string 9174 err = json.Unmarshal(*v, &typeVar) 9175 if err != nil { 9176 return err 9177 } 9178 se.Type = &typeVar 9179 } 9180 } 9181 } 9182 9183 return nil 9184} 9185 9186// StreamingEndpointAccessControl streamingEndpoint access control definition. 9187type StreamingEndpointAccessControl struct { 9188 // Akamai - The access control of Akamai 9189 Akamai *AkamaiAccessControl `json:"akamai,omitempty"` 9190 // IP - The IP access control of the StreamingEndpoint. 9191 IP *IPAccessControl `json:"ip,omitempty"` 9192} 9193 9194// StreamingEndpointListResult the StreamingEndpoint list result. 9195type StreamingEndpointListResult struct { 9196 autorest.Response `json:"-"` 9197 // Value - The result of the List StreamingEndpoint operation. 9198 Value *[]StreamingEndpoint `json:"value,omitempty"` 9199 // OdataCount - The number of result. 9200 OdataCount *int32 `json:"@odata.count,omitempty"` 9201 // OdataNextLink - Th link to the next set of results. Not empty if value contains incomplete list of StreamingEndpoints. 9202 OdataNextLink *string `json:"@odata.nextLink,omitempty"` 9203} 9204 9205// StreamingEndpointListResultIterator provides access to a complete listing of StreamingEndpoint values. 9206type StreamingEndpointListResultIterator struct { 9207 i int 9208 page StreamingEndpointListResultPage 9209} 9210 9211// NextWithContext advances to the next value. If there was an error making 9212// the request the iterator does not advance and the error is returned. 9213func (iter *StreamingEndpointListResultIterator) NextWithContext(ctx context.Context) (err error) { 9214 if tracing.IsEnabled() { 9215 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingEndpointListResultIterator.NextWithContext") 9216 defer func() { 9217 sc := -1 9218 if iter.Response().Response.Response != nil { 9219 sc = iter.Response().Response.Response.StatusCode 9220 } 9221 tracing.EndSpan(ctx, sc, err) 9222 }() 9223 } 9224 iter.i++ 9225 if iter.i < len(iter.page.Values()) { 9226 return nil 9227 } 9228 err = iter.page.NextWithContext(ctx) 9229 if err != nil { 9230 iter.i-- 9231 return err 9232 } 9233 iter.i = 0 9234 return nil 9235} 9236 9237// Next advances to the next value. If there was an error making 9238// the request the iterator does not advance and the error is returned. 9239// Deprecated: Use NextWithContext() instead. 9240func (iter *StreamingEndpointListResultIterator) Next() error { 9241 return iter.NextWithContext(context.Background()) 9242} 9243 9244// NotDone returns true if the enumeration should be started or is not yet complete. 9245func (iter StreamingEndpointListResultIterator) NotDone() bool { 9246 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9247} 9248 9249// Response returns the raw server response from the last page request. 9250func (iter StreamingEndpointListResultIterator) Response() StreamingEndpointListResult { 9251 return iter.page.Response() 9252} 9253 9254// Value returns the current value or a zero-initialized value if the 9255// iterator has advanced beyond the end of the collection. 9256func (iter StreamingEndpointListResultIterator) Value() StreamingEndpoint { 9257 if !iter.page.NotDone() { 9258 return StreamingEndpoint{} 9259 } 9260 return iter.page.Values()[iter.i] 9261} 9262 9263// Creates a new instance of the StreamingEndpointListResultIterator type. 9264func NewStreamingEndpointListResultIterator(page StreamingEndpointListResultPage) StreamingEndpointListResultIterator { 9265 return StreamingEndpointListResultIterator{page: page} 9266} 9267 9268// IsEmpty returns true if the ListResult contains no values. 9269func (selr StreamingEndpointListResult) IsEmpty() bool { 9270 return selr.Value == nil || len(*selr.Value) == 0 9271} 9272 9273// streamingEndpointListResultPreparer prepares a request to retrieve the next set of results. 9274// It returns nil if no more results exist. 9275func (selr StreamingEndpointListResult) streamingEndpointListResultPreparer(ctx context.Context) (*http.Request, error) { 9276 if selr.OdataNextLink == nil || len(to.String(selr.OdataNextLink)) < 1 { 9277 return nil, nil 9278 } 9279 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9280 autorest.AsJSON(), 9281 autorest.AsGet(), 9282 autorest.WithBaseURL(to.String(selr.OdataNextLink))) 9283} 9284 9285// StreamingEndpointListResultPage contains a page of StreamingEndpoint values. 9286type StreamingEndpointListResultPage struct { 9287 fn func(context.Context, StreamingEndpointListResult) (StreamingEndpointListResult, error) 9288 selr StreamingEndpointListResult 9289} 9290 9291// NextWithContext advances to the next page of values. If there was an error making 9292// the request the page does not advance and the error is returned. 9293func (page *StreamingEndpointListResultPage) NextWithContext(ctx context.Context) (err error) { 9294 if tracing.IsEnabled() { 9295 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingEndpointListResultPage.NextWithContext") 9296 defer func() { 9297 sc := -1 9298 if page.Response().Response.Response != nil { 9299 sc = page.Response().Response.Response.StatusCode 9300 } 9301 tracing.EndSpan(ctx, sc, err) 9302 }() 9303 } 9304 next, err := page.fn(ctx, page.selr) 9305 if err != nil { 9306 return err 9307 } 9308 page.selr = next 9309 return nil 9310} 9311 9312// Next advances to the next page of values. If there was an error making 9313// the request the page does not advance and the error is returned. 9314// Deprecated: Use NextWithContext() instead. 9315func (page *StreamingEndpointListResultPage) Next() error { 9316 return page.NextWithContext(context.Background()) 9317} 9318 9319// NotDone returns true if the page enumeration should be started or is not yet complete. 9320func (page StreamingEndpointListResultPage) NotDone() bool { 9321 return !page.selr.IsEmpty() 9322} 9323 9324// Response returns the raw server response from the last page request. 9325func (page StreamingEndpointListResultPage) Response() StreamingEndpointListResult { 9326 return page.selr 9327} 9328 9329// Values returns the slice of values for the current page or nil if there are no values. 9330func (page StreamingEndpointListResultPage) Values() []StreamingEndpoint { 9331 if page.selr.IsEmpty() { 9332 return nil 9333 } 9334 return *page.selr.Value 9335} 9336 9337// Creates a new instance of the StreamingEndpointListResultPage type. 9338func NewStreamingEndpointListResultPage(getNextPage func(context.Context, StreamingEndpointListResult) (StreamingEndpointListResult, error)) StreamingEndpointListResultPage { 9339 return StreamingEndpointListResultPage{fn: getNextPage} 9340} 9341 9342// StreamingEndpointProperties the StreamingEndpoint properties. 9343type StreamingEndpointProperties struct { 9344 // Description - The StreamingEndpoint description. 9345 Description *string `json:"description,omitempty"` 9346 // ScaleUnits - The number of scale units. Use the Scale operation to adjust this value. 9347 ScaleUnits *int32 `json:"scaleUnits,omitempty"` 9348 // AvailabilitySetName - The name of the AvailabilitySet used with this StreamingEndpoint for high availability streaming. This value can only be set at creation time. 9349 AvailabilitySetName *string `json:"availabilitySetName,omitempty"` 9350 // AccessControl - The access control definition of the StreamingEndpoint. 9351 AccessControl *StreamingEndpointAccessControl `json:"accessControl,omitempty"` 9352 // MaxCacheAge - Max cache age 9353 MaxCacheAge *int64 `json:"maxCacheAge,omitempty"` 9354 // CustomHostNames - The custom host names of the StreamingEndpoint 9355 CustomHostNames *[]string `json:"customHostNames,omitempty"` 9356 // HostName - READ-ONLY; The StreamingEndpoint host name. 9357 HostName *string `json:"hostName,omitempty"` 9358 // CdnEnabled - The CDN enabled flag. 9359 CdnEnabled *bool `json:"cdnEnabled,omitempty"` 9360 // CdnProvider - The CDN provider name. 9361 CdnProvider *string `json:"cdnProvider,omitempty"` 9362 // CdnProfile - The CDN profile name. 9363 CdnProfile *string `json:"cdnProfile,omitempty"` 9364 // ProvisioningState - READ-ONLY; The provisioning state of the StreamingEndpoint. 9365 ProvisioningState *string `json:"provisioningState,omitempty"` 9366 // ResourceState - READ-ONLY; The resource state of the StreamingEndpoint. Possible values include: 'StreamingEndpointResourceStateStopped', 'StreamingEndpointResourceStateStarting', 'StreamingEndpointResourceStateRunning', 'StreamingEndpointResourceStateStopping', 'StreamingEndpointResourceStateDeleting', 'StreamingEndpointResourceStateScaling' 9367 ResourceState StreamingEndpointResourceState `json:"resourceState,omitempty"` 9368 // CrossSiteAccessPolicies - The StreamingEndpoint access policies. 9369 CrossSiteAccessPolicies *CrossSiteAccessPolicies `json:"crossSiteAccessPolicies,omitempty"` 9370 // FreeTrialEndTime - READ-ONLY; The free trial expiration time. 9371 FreeTrialEndTime *date.Time `json:"freeTrialEndTime,omitempty"` 9372 // Created - READ-ONLY; The exact time the StreamingEndpoint was created. 9373 Created *date.Time `json:"created,omitempty"` 9374 // LastModified - READ-ONLY; The exact time the StreamingEndpoint was last modified. 9375 LastModified *date.Time `json:"lastModified,omitempty"` 9376} 9377 9378// StreamingEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a 9379// long-running operation. 9380type StreamingEndpointsCreateFuture struct { 9381 azure.Future 9382} 9383 9384// Result returns the result of the asynchronous operation. 9385// If the operation has not completed it will return an error. 9386func (future *StreamingEndpointsCreateFuture) Result(client StreamingEndpointsClient) (se StreamingEndpoint, err error) { 9387 var done bool 9388 done, err = future.DoneWithContext(context.Background(), client) 9389 if err != nil { 9390 err = autorest.NewErrorWithError(err, "media.StreamingEndpointsCreateFuture", "Result", future.Response(), "Polling failure") 9391 return 9392 } 9393 if !done { 9394 err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsCreateFuture") 9395 return 9396 } 9397 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9398 if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent { 9399 se, err = client.CreateResponder(se.Response.Response) 9400 if err != nil { 9401 err = autorest.NewErrorWithError(err, "media.StreamingEndpointsCreateFuture", "Result", se.Response.Response, "Failure responding to request") 9402 } 9403 } 9404 return 9405} 9406 9407// StreamingEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a 9408// long-running operation. 9409type StreamingEndpointsDeleteFuture struct { 9410 azure.Future 9411} 9412 9413// Result returns the result of the asynchronous operation. 9414// If the operation has not completed it will return an error. 9415func (future *StreamingEndpointsDeleteFuture) Result(client StreamingEndpointsClient) (ar autorest.Response, err error) { 9416 var done bool 9417 done, err = future.DoneWithContext(context.Background(), client) 9418 if err != nil { 9419 err = autorest.NewErrorWithError(err, "media.StreamingEndpointsDeleteFuture", "Result", future.Response(), "Polling failure") 9420 return 9421 } 9422 if !done { 9423 err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsDeleteFuture") 9424 return 9425 } 9426 ar.Response = future.Response() 9427 return 9428} 9429 9430// StreamingEndpointsScaleFuture an abstraction for monitoring and retrieving the results of a long-running 9431// operation. 9432type StreamingEndpointsScaleFuture struct { 9433 azure.Future 9434} 9435 9436// Result returns the result of the asynchronous operation. 9437// If the operation has not completed it will return an error. 9438func (future *StreamingEndpointsScaleFuture) Result(client StreamingEndpointsClient) (ar autorest.Response, err error) { 9439 var done bool 9440 done, err = future.DoneWithContext(context.Background(), client) 9441 if err != nil { 9442 err = autorest.NewErrorWithError(err, "media.StreamingEndpointsScaleFuture", "Result", future.Response(), "Polling failure") 9443 return 9444 } 9445 if !done { 9446 err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsScaleFuture") 9447 return 9448 } 9449 ar.Response = future.Response() 9450 return 9451} 9452 9453// StreamingEndpointsStartFuture an abstraction for monitoring and retrieving the results of a long-running 9454// operation. 9455type StreamingEndpointsStartFuture struct { 9456 azure.Future 9457} 9458 9459// Result returns the result of the asynchronous operation. 9460// If the operation has not completed it will return an error. 9461func (future *StreamingEndpointsStartFuture) Result(client StreamingEndpointsClient) (ar autorest.Response, err error) { 9462 var done bool 9463 done, err = future.DoneWithContext(context.Background(), client) 9464 if err != nil { 9465 err = autorest.NewErrorWithError(err, "media.StreamingEndpointsStartFuture", "Result", future.Response(), "Polling failure") 9466 return 9467 } 9468 if !done { 9469 err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsStartFuture") 9470 return 9471 } 9472 ar.Response = future.Response() 9473 return 9474} 9475 9476// StreamingEndpointsStopFuture an abstraction for monitoring and retrieving the results of a long-running 9477// operation. 9478type StreamingEndpointsStopFuture struct { 9479 azure.Future 9480} 9481 9482// Result returns the result of the asynchronous operation. 9483// If the operation has not completed it will return an error. 9484func (future *StreamingEndpointsStopFuture) Result(client StreamingEndpointsClient) (ar autorest.Response, err error) { 9485 var done bool 9486 done, err = future.DoneWithContext(context.Background(), client) 9487 if err != nil { 9488 err = autorest.NewErrorWithError(err, "media.StreamingEndpointsStopFuture", "Result", future.Response(), "Polling failure") 9489 return 9490 } 9491 if !done { 9492 err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsStopFuture") 9493 return 9494 } 9495 ar.Response = future.Response() 9496 return 9497} 9498 9499// StreamingEndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a 9500// long-running operation. 9501type StreamingEndpointsUpdateFuture struct { 9502 azure.Future 9503} 9504 9505// Result returns the result of the asynchronous operation. 9506// If the operation has not completed it will return an error. 9507func (future *StreamingEndpointsUpdateFuture) Result(client StreamingEndpointsClient) (se StreamingEndpoint, err error) { 9508 var done bool 9509 done, err = future.DoneWithContext(context.Background(), client) 9510 if err != nil { 9511 err = autorest.NewErrorWithError(err, "media.StreamingEndpointsUpdateFuture", "Result", future.Response(), "Polling failure") 9512 return 9513 } 9514 if !done { 9515 err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsUpdateFuture") 9516 return 9517 } 9518 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9519 if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent { 9520 se, err = client.UpdateResponder(se.Response.Response) 9521 if err != nil { 9522 err = autorest.NewErrorWithError(err, "media.StreamingEndpointsUpdateFuture", "Result", se.Response.Response, "Failure responding to request") 9523 } 9524 } 9525 return 9526} 9527 9528// StreamingEntityScaleUnit scale units definition 9529type StreamingEntityScaleUnit struct { 9530 // ScaleUnit - The scale unit number of the StreamingEndpoint. 9531 ScaleUnit *int32 `json:"scaleUnit,omitempty"` 9532} 9533 9534// StreamingLocator a Streaming Locator resource 9535type StreamingLocator struct { 9536 autorest.Response `json:"-"` 9537 *StreamingLocatorProperties `json:"properties,omitempty"` 9538 // ID - READ-ONLY; Fully qualified resource ID for the resource. 9539 ID *string `json:"id,omitempty"` 9540 // Name - READ-ONLY; The name of the resource. 9541 Name *string `json:"name,omitempty"` 9542 // Type - READ-ONLY; The type of the resource. 9543 Type *string `json:"type,omitempty"` 9544} 9545 9546// MarshalJSON is the custom marshaler for StreamingLocator. 9547func (sl StreamingLocator) MarshalJSON() ([]byte, error) { 9548 objectMap := make(map[string]interface{}) 9549 if sl.StreamingLocatorProperties != nil { 9550 objectMap["properties"] = sl.StreamingLocatorProperties 9551 } 9552 return json.Marshal(objectMap) 9553} 9554 9555// UnmarshalJSON is the custom unmarshaler for StreamingLocator struct. 9556func (sl *StreamingLocator) UnmarshalJSON(body []byte) error { 9557 var m map[string]*json.RawMessage 9558 err := json.Unmarshal(body, &m) 9559 if err != nil { 9560 return err 9561 } 9562 for k, v := range m { 9563 switch k { 9564 case "properties": 9565 if v != nil { 9566 var streamingLocatorProperties StreamingLocatorProperties 9567 err = json.Unmarshal(*v, &streamingLocatorProperties) 9568 if err != nil { 9569 return err 9570 } 9571 sl.StreamingLocatorProperties = &streamingLocatorProperties 9572 } 9573 case "id": 9574 if v != nil { 9575 var ID string 9576 err = json.Unmarshal(*v, &ID) 9577 if err != nil { 9578 return err 9579 } 9580 sl.ID = &ID 9581 } 9582 case "name": 9583 if v != nil { 9584 var name string 9585 err = json.Unmarshal(*v, &name) 9586 if err != nil { 9587 return err 9588 } 9589 sl.Name = &name 9590 } 9591 case "type": 9592 if v != nil { 9593 var typeVar string 9594 err = json.Unmarshal(*v, &typeVar) 9595 if err != nil { 9596 return err 9597 } 9598 sl.Type = &typeVar 9599 } 9600 } 9601 } 9602 9603 return nil 9604} 9605 9606// StreamingLocatorCollection a collection of StreamingLocator items. 9607type StreamingLocatorCollection struct { 9608 autorest.Response `json:"-"` 9609 // Value - A collection of StreamingLocator items. 9610 Value *[]StreamingLocator `json:"value,omitempty"` 9611 // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). 9612 OdataNextLink *string `json:"@odata.nextLink,omitempty"` 9613} 9614 9615// StreamingLocatorCollectionIterator provides access to a complete listing of StreamingLocator values. 9616type StreamingLocatorCollectionIterator struct { 9617 i int 9618 page StreamingLocatorCollectionPage 9619} 9620 9621// NextWithContext advances to the next value. If there was an error making 9622// the request the iterator does not advance and the error is returned. 9623func (iter *StreamingLocatorCollectionIterator) NextWithContext(ctx context.Context) (err error) { 9624 if tracing.IsEnabled() { 9625 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorCollectionIterator.NextWithContext") 9626 defer func() { 9627 sc := -1 9628 if iter.Response().Response.Response != nil { 9629 sc = iter.Response().Response.Response.StatusCode 9630 } 9631 tracing.EndSpan(ctx, sc, err) 9632 }() 9633 } 9634 iter.i++ 9635 if iter.i < len(iter.page.Values()) { 9636 return nil 9637 } 9638 err = iter.page.NextWithContext(ctx) 9639 if err != nil { 9640 iter.i-- 9641 return err 9642 } 9643 iter.i = 0 9644 return nil 9645} 9646 9647// Next advances to the next value. If there was an error making 9648// the request the iterator does not advance and the error is returned. 9649// Deprecated: Use NextWithContext() instead. 9650func (iter *StreamingLocatorCollectionIterator) Next() error { 9651 return iter.NextWithContext(context.Background()) 9652} 9653 9654// NotDone returns true if the enumeration should be started or is not yet complete. 9655func (iter StreamingLocatorCollectionIterator) NotDone() bool { 9656 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9657} 9658 9659// Response returns the raw server response from the last page request. 9660func (iter StreamingLocatorCollectionIterator) Response() StreamingLocatorCollection { 9661 return iter.page.Response() 9662} 9663 9664// Value returns the current value or a zero-initialized value if the 9665// iterator has advanced beyond the end of the collection. 9666func (iter StreamingLocatorCollectionIterator) Value() StreamingLocator { 9667 if !iter.page.NotDone() { 9668 return StreamingLocator{} 9669 } 9670 return iter.page.Values()[iter.i] 9671} 9672 9673// Creates a new instance of the StreamingLocatorCollectionIterator type. 9674func NewStreamingLocatorCollectionIterator(page StreamingLocatorCollectionPage) StreamingLocatorCollectionIterator { 9675 return StreamingLocatorCollectionIterator{page: page} 9676} 9677 9678// IsEmpty returns true if the ListResult contains no values. 9679func (slc StreamingLocatorCollection) IsEmpty() bool { 9680 return slc.Value == nil || len(*slc.Value) == 0 9681} 9682 9683// streamingLocatorCollectionPreparer prepares a request to retrieve the next set of results. 9684// It returns nil if no more results exist. 9685func (slc StreamingLocatorCollection) streamingLocatorCollectionPreparer(ctx context.Context) (*http.Request, error) { 9686 if slc.OdataNextLink == nil || len(to.String(slc.OdataNextLink)) < 1 { 9687 return nil, nil 9688 } 9689 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9690 autorest.AsJSON(), 9691 autorest.AsGet(), 9692 autorest.WithBaseURL(to.String(slc.OdataNextLink))) 9693} 9694 9695// StreamingLocatorCollectionPage contains a page of StreamingLocator values. 9696type StreamingLocatorCollectionPage struct { 9697 fn func(context.Context, StreamingLocatorCollection) (StreamingLocatorCollection, error) 9698 slc StreamingLocatorCollection 9699} 9700 9701// NextWithContext advances to the next page of values. If there was an error making 9702// the request the page does not advance and the error is returned. 9703func (page *StreamingLocatorCollectionPage) NextWithContext(ctx context.Context) (err error) { 9704 if tracing.IsEnabled() { 9705 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorCollectionPage.NextWithContext") 9706 defer func() { 9707 sc := -1 9708 if page.Response().Response.Response != nil { 9709 sc = page.Response().Response.Response.StatusCode 9710 } 9711 tracing.EndSpan(ctx, sc, err) 9712 }() 9713 } 9714 next, err := page.fn(ctx, page.slc) 9715 if err != nil { 9716 return err 9717 } 9718 page.slc = next 9719 return nil 9720} 9721 9722// Next advances to the next page of values. If there was an error making 9723// the request the page does not advance and the error is returned. 9724// Deprecated: Use NextWithContext() instead. 9725func (page *StreamingLocatorCollectionPage) Next() error { 9726 return page.NextWithContext(context.Background()) 9727} 9728 9729// NotDone returns true if the page enumeration should be started or is not yet complete. 9730func (page StreamingLocatorCollectionPage) NotDone() bool { 9731 return !page.slc.IsEmpty() 9732} 9733 9734// Response returns the raw server response from the last page request. 9735func (page StreamingLocatorCollectionPage) Response() StreamingLocatorCollection { 9736 return page.slc 9737} 9738 9739// Values returns the slice of values for the current page or nil if there are no values. 9740func (page StreamingLocatorCollectionPage) Values() []StreamingLocator { 9741 if page.slc.IsEmpty() { 9742 return nil 9743 } 9744 return *page.slc.Value 9745} 9746 9747// Creates a new instance of the StreamingLocatorCollectionPage type. 9748func NewStreamingLocatorCollectionPage(getNextPage func(context.Context, StreamingLocatorCollection) (StreamingLocatorCollection, error)) StreamingLocatorCollectionPage { 9749 return StreamingLocatorCollectionPage{fn: getNextPage} 9750} 9751 9752// StreamingLocatorContentKey class for content key in Streaming Locator 9753type StreamingLocatorContentKey struct { 9754 // ID - ID of Content Key 9755 ID *uuid.UUID `json:"id,omitempty"` 9756 // Type - READ-ONLY; Encryption type of Content Key. Possible values include: 'StreamingLocatorContentKeyTypeCommonEncryptionCenc', 'StreamingLocatorContentKeyTypeCommonEncryptionCbcs', 'StreamingLocatorContentKeyTypeEnvelopeEncryption' 9757 Type StreamingLocatorContentKeyType `json:"type,omitempty"` 9758 // LabelReferenceInStreamingPolicy - Label of Content Key as specified in the Streaming Policy 9759 LabelReferenceInStreamingPolicy *string `json:"labelReferenceInStreamingPolicy,omitempty"` 9760 // Value - Value of Content Key 9761 Value *string `json:"value,omitempty"` 9762 // PolicyName - READ-ONLY; ContentKeyPolicy used by Content Key 9763 PolicyName *string `json:"policyName,omitempty"` 9764 // Tracks - READ-ONLY; Tracks which use this Content Key 9765 Tracks *[]TrackSelection `json:"tracks,omitempty"` 9766} 9767 9768// StreamingLocatorProperties properties of the Streaming Locator. 9769type StreamingLocatorProperties struct { 9770 // AssetName - Asset Name 9771 AssetName *string `json:"assetName,omitempty"` 9772 // Created - READ-ONLY; The creation time of the Streaming Locator. 9773 Created *date.Time `json:"created,omitempty"` 9774 // StartTime - The start time of the Streaming Locator. 9775 StartTime *date.Time `json:"startTime,omitempty"` 9776 // EndTime - The end time of the Streaming Locator. 9777 EndTime *date.Time `json:"endTime,omitempty"` 9778 // StreamingLocatorID - The StreamingLocatorId of the Streaming Locator. 9779 StreamingLocatorID *uuid.UUID `json:"streamingLocatorId,omitempty"` 9780 // StreamingPolicyName - Name of the Streaming Policy used by this Streaming Locator. Either specify the name of Streaming Policy you created or use one of the predefined Streaming Policies. The predefined Streaming Policies available are: 'Predefined_DownloadOnly', 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', 'Predefined_ClearKey', 'Predefined_MultiDrmCencStreaming' and 'Predefined_MultiDrmStreaming' 9781 StreamingPolicyName *string `json:"streamingPolicyName,omitempty"` 9782 // DefaultContentKeyPolicyName - Name of the default ContentKeyPolicy used by this Streaming Locator. 9783 DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"` 9784 // ContentKeys - The ContentKeys used by this Streaming Locator. 9785 ContentKeys *[]StreamingLocatorContentKey `json:"contentKeys,omitempty"` 9786 // AlternativeMediaID - Alternative Media ID of this Streaming Locator 9787 AlternativeMediaID *string `json:"alternativeMediaId,omitempty"` 9788 // Filters - A list of asset or account filters which apply to this streaming locator 9789 Filters *[]string `json:"filters,omitempty"` 9790} 9791 9792// StreamingPath class of paths for streaming 9793type StreamingPath struct { 9794 // StreamingProtocol - Streaming protocol. Possible values include: 'StreamingPolicyStreamingProtocolHls', 'StreamingPolicyStreamingProtocolDash', 'StreamingPolicyStreamingProtocolSmoothStreaming', 'StreamingPolicyStreamingProtocolDownload' 9795 StreamingProtocol StreamingPolicyStreamingProtocol `json:"streamingProtocol,omitempty"` 9796 // EncryptionScheme - Encryption scheme. Possible values include: 'EncryptionSchemeNoEncryption', 'EncryptionSchemeEnvelopeEncryption', 'EncryptionSchemeCommonEncryptionCenc', 'EncryptionSchemeCommonEncryptionCbcs' 9797 EncryptionScheme EncryptionScheme `json:"encryptionScheme,omitempty"` 9798 // Paths - Streaming paths for each protocol and encryptionScheme pair 9799 Paths *[]string `json:"paths,omitempty"` 9800} 9801 9802// StreamingPolicy a Streaming Policy resource 9803type StreamingPolicy struct { 9804 autorest.Response `json:"-"` 9805 *StreamingPolicyProperties `json:"properties,omitempty"` 9806 // ID - READ-ONLY; Fully qualified resource ID for the resource. 9807 ID *string `json:"id,omitempty"` 9808 // Name - READ-ONLY; The name of the resource. 9809 Name *string `json:"name,omitempty"` 9810 // Type - READ-ONLY; The type of the resource. 9811 Type *string `json:"type,omitempty"` 9812} 9813 9814// MarshalJSON is the custom marshaler for StreamingPolicy. 9815func (sp StreamingPolicy) MarshalJSON() ([]byte, error) { 9816 objectMap := make(map[string]interface{}) 9817 if sp.StreamingPolicyProperties != nil { 9818 objectMap["properties"] = sp.StreamingPolicyProperties 9819 } 9820 return json.Marshal(objectMap) 9821} 9822 9823// UnmarshalJSON is the custom unmarshaler for StreamingPolicy struct. 9824func (sp *StreamingPolicy) UnmarshalJSON(body []byte) error { 9825 var m map[string]*json.RawMessage 9826 err := json.Unmarshal(body, &m) 9827 if err != nil { 9828 return err 9829 } 9830 for k, v := range m { 9831 switch k { 9832 case "properties": 9833 if v != nil { 9834 var streamingPolicyProperties StreamingPolicyProperties 9835 err = json.Unmarshal(*v, &streamingPolicyProperties) 9836 if err != nil { 9837 return err 9838 } 9839 sp.StreamingPolicyProperties = &streamingPolicyProperties 9840 } 9841 case "id": 9842 if v != nil { 9843 var ID string 9844 err = json.Unmarshal(*v, &ID) 9845 if err != nil { 9846 return err 9847 } 9848 sp.ID = &ID 9849 } 9850 case "name": 9851 if v != nil { 9852 var name string 9853 err = json.Unmarshal(*v, &name) 9854 if err != nil { 9855 return err 9856 } 9857 sp.Name = &name 9858 } 9859 case "type": 9860 if v != nil { 9861 var typeVar string 9862 err = json.Unmarshal(*v, &typeVar) 9863 if err != nil { 9864 return err 9865 } 9866 sp.Type = &typeVar 9867 } 9868 } 9869 } 9870 9871 return nil 9872} 9873 9874// StreamingPolicyCollection a collection of StreamingPolicy items. 9875type StreamingPolicyCollection struct { 9876 autorest.Response `json:"-"` 9877 // Value - A collection of StreamingPolicy items. 9878 Value *[]StreamingPolicy `json:"value,omitempty"` 9879 // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). 9880 OdataNextLink *string `json:"@odata.nextLink,omitempty"` 9881} 9882 9883// StreamingPolicyCollectionIterator provides access to a complete listing of StreamingPolicy values. 9884type StreamingPolicyCollectionIterator struct { 9885 i int 9886 page StreamingPolicyCollectionPage 9887} 9888 9889// NextWithContext advances to the next value. If there was an error making 9890// the request the iterator does not advance and the error is returned. 9891func (iter *StreamingPolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) { 9892 if tracing.IsEnabled() { 9893 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingPolicyCollectionIterator.NextWithContext") 9894 defer func() { 9895 sc := -1 9896 if iter.Response().Response.Response != nil { 9897 sc = iter.Response().Response.Response.StatusCode 9898 } 9899 tracing.EndSpan(ctx, sc, err) 9900 }() 9901 } 9902 iter.i++ 9903 if iter.i < len(iter.page.Values()) { 9904 return nil 9905 } 9906 err = iter.page.NextWithContext(ctx) 9907 if err != nil { 9908 iter.i-- 9909 return err 9910 } 9911 iter.i = 0 9912 return nil 9913} 9914 9915// Next advances to the next value. If there was an error making 9916// the request the iterator does not advance and the error is returned. 9917// Deprecated: Use NextWithContext() instead. 9918func (iter *StreamingPolicyCollectionIterator) Next() error { 9919 return iter.NextWithContext(context.Background()) 9920} 9921 9922// NotDone returns true if the enumeration should be started or is not yet complete. 9923func (iter StreamingPolicyCollectionIterator) NotDone() bool { 9924 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9925} 9926 9927// Response returns the raw server response from the last page request. 9928func (iter StreamingPolicyCollectionIterator) Response() StreamingPolicyCollection { 9929 return iter.page.Response() 9930} 9931 9932// Value returns the current value or a zero-initialized value if the 9933// iterator has advanced beyond the end of the collection. 9934func (iter StreamingPolicyCollectionIterator) Value() StreamingPolicy { 9935 if !iter.page.NotDone() { 9936 return StreamingPolicy{} 9937 } 9938 return iter.page.Values()[iter.i] 9939} 9940 9941// Creates a new instance of the StreamingPolicyCollectionIterator type. 9942func NewStreamingPolicyCollectionIterator(page StreamingPolicyCollectionPage) StreamingPolicyCollectionIterator { 9943 return StreamingPolicyCollectionIterator{page: page} 9944} 9945 9946// IsEmpty returns true if the ListResult contains no values. 9947func (spc StreamingPolicyCollection) IsEmpty() bool { 9948 return spc.Value == nil || len(*spc.Value) == 0 9949} 9950 9951// streamingPolicyCollectionPreparer prepares a request to retrieve the next set of results. 9952// It returns nil if no more results exist. 9953func (spc StreamingPolicyCollection) streamingPolicyCollectionPreparer(ctx context.Context) (*http.Request, error) { 9954 if spc.OdataNextLink == nil || len(to.String(spc.OdataNextLink)) < 1 { 9955 return nil, nil 9956 } 9957 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9958 autorest.AsJSON(), 9959 autorest.AsGet(), 9960 autorest.WithBaseURL(to.String(spc.OdataNextLink))) 9961} 9962 9963// StreamingPolicyCollectionPage contains a page of StreamingPolicy values. 9964type StreamingPolicyCollectionPage struct { 9965 fn func(context.Context, StreamingPolicyCollection) (StreamingPolicyCollection, error) 9966 spc StreamingPolicyCollection 9967} 9968 9969// NextWithContext advances to the next page of values. If there was an error making 9970// the request the page does not advance and the error is returned. 9971func (page *StreamingPolicyCollectionPage) NextWithContext(ctx context.Context) (err error) { 9972 if tracing.IsEnabled() { 9973 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingPolicyCollectionPage.NextWithContext") 9974 defer func() { 9975 sc := -1 9976 if page.Response().Response.Response != nil { 9977 sc = page.Response().Response.Response.StatusCode 9978 } 9979 tracing.EndSpan(ctx, sc, err) 9980 }() 9981 } 9982 next, err := page.fn(ctx, page.spc) 9983 if err != nil { 9984 return err 9985 } 9986 page.spc = next 9987 return nil 9988} 9989 9990// Next advances to the next page of values. If there was an error making 9991// the request the page does not advance and the error is returned. 9992// Deprecated: Use NextWithContext() instead. 9993func (page *StreamingPolicyCollectionPage) Next() error { 9994 return page.NextWithContext(context.Background()) 9995} 9996 9997// NotDone returns true if the page enumeration should be started or is not yet complete. 9998func (page StreamingPolicyCollectionPage) NotDone() bool { 9999 return !page.spc.IsEmpty() 10000} 10001 10002// Response returns the raw server response from the last page request. 10003func (page StreamingPolicyCollectionPage) Response() StreamingPolicyCollection { 10004 return page.spc 10005} 10006 10007// Values returns the slice of values for the current page or nil if there are no values. 10008func (page StreamingPolicyCollectionPage) Values() []StreamingPolicy { 10009 if page.spc.IsEmpty() { 10010 return nil 10011 } 10012 return *page.spc.Value 10013} 10014 10015// Creates a new instance of the StreamingPolicyCollectionPage type. 10016func NewStreamingPolicyCollectionPage(getNextPage func(context.Context, StreamingPolicyCollection) (StreamingPolicyCollection, error)) StreamingPolicyCollectionPage { 10017 return StreamingPolicyCollectionPage{fn: getNextPage} 10018} 10019 10020// StreamingPolicyContentKey class to specify properties of content key 10021type StreamingPolicyContentKey struct { 10022 // Label - Label can be used to specify Content Key when creating a Streaming Locator 10023 Label *string `json:"label,omitempty"` 10024 // PolicyName - Policy used by Content Key 10025 PolicyName *string `json:"policyName,omitempty"` 10026 // Tracks - Tracks which use this content key 10027 Tracks *[]TrackSelection `json:"tracks,omitempty"` 10028} 10029 10030// StreamingPolicyContentKeys class to specify properties of all content keys in Streaming Policy 10031type StreamingPolicyContentKeys struct { 10032 // DefaultKey - Default content key for an encryption scheme 10033 DefaultKey *DefaultKey `json:"defaultKey,omitempty"` 10034 // KeyToTrackMappings - Representing tracks needs separate content key 10035 KeyToTrackMappings *[]StreamingPolicyContentKey `json:"keyToTrackMappings,omitempty"` 10036} 10037 10038// StreamingPolicyFairPlayConfiguration class to specify configurations of FairPlay in Streaming Policy 10039type StreamingPolicyFairPlayConfiguration struct { 10040 // CustomLicenseAcquisitionURLTemplate - Template for the URL of the custom service delivering licenses to end user players. Not required when using Azure Media Services for issuing licenses. The template supports replaceable tokens that the service will update at runtime with the value specific to the request. The currently supported token values are {AlternativeMediaId}, which is replaced with the value of StreamingLocatorId.AlternativeMediaId, and {ContentKeyId}, which is replaced with the value of identifier of the key being requested. 10041 CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"` 10042 // AllowPersistentLicense - All license to be persistent or not 10043 AllowPersistentLicense *bool `json:"allowPersistentLicense,omitempty"` 10044} 10045 10046// StreamingPolicyPlayReadyConfiguration class to specify configurations of PlayReady in Streaming Policy 10047type StreamingPolicyPlayReadyConfiguration struct { 10048 // CustomLicenseAcquisitionURLTemplate - Template for the URL of the custom service delivering licenses to end user players. Not required when using Azure Media Services for issuing licenses. The template supports replaceable tokens that the service will update at runtime with the value specific to the request. The currently supported token values are {AlternativeMediaId}, which is replaced with the value of StreamingLocatorId.AlternativeMediaId, and {ContentKeyId}, which is replaced with the value of identifier of the key being requested. 10049 CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"` 10050 // PlayReadyCustomAttributes - Custom attributes for PlayReady 10051 PlayReadyCustomAttributes *string `json:"playReadyCustomAttributes,omitempty"` 10052} 10053 10054// StreamingPolicyProperties class to specify properties of Streaming Policy 10055type StreamingPolicyProperties struct { 10056 // Created - READ-ONLY; Creation time of Streaming Policy 10057 Created *date.Time `json:"created,omitempty"` 10058 // DefaultContentKeyPolicyName - Default ContentKey used by current Streaming Policy 10059 DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"` 10060 // EnvelopeEncryption - Configuration of EnvelopeEncryption 10061 EnvelopeEncryption *EnvelopeEncryption `json:"envelopeEncryption,omitempty"` 10062 // CommonEncryptionCenc - Configuration of CommonEncryptionCenc 10063 CommonEncryptionCenc *CommonEncryptionCenc `json:"commonEncryptionCenc,omitempty"` 10064 // CommonEncryptionCbcs - Configuration of CommonEncryptionCbcs 10065 CommonEncryptionCbcs *CommonEncryptionCbcs `json:"commonEncryptionCbcs,omitempty"` 10066 // NoEncryption - Configurations of NoEncryption 10067 NoEncryption *NoEncryption `json:"noEncryption,omitempty"` 10068} 10069 10070// StreamingPolicyWidevineConfiguration class to specify configurations of Widevine in Streaming Policy 10071type StreamingPolicyWidevineConfiguration struct { 10072 // CustomLicenseAcquisitionURLTemplate - Template for the URL of the custom service delivering licenses to end user players. Not required when using Azure Media Services for issuing licenses. The template supports replaceable tokens that the service will update at runtime with the value specific to the request. The currently supported token values are {AlternativeMediaId}, which is replaced with the value of StreamingLocatorId.AlternativeMediaId, and {ContentKeyId}, which is replaced with the value of identifier of the key being requested. 10073 CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"` 10074} 10075 10076// SubscriptionMediaService a Media Services account. 10077type SubscriptionMediaService struct { 10078 autorest.Response `json:"-"` 10079 // ServiceProperties - The resource properties. 10080 *ServiceProperties `json:"properties,omitempty"` 10081 // Tags - Resource tags. 10082 Tags map[string]*string `json:"tags"` 10083 // Location - The Azure Region of the resource. 10084 Location *string `json:"location,omitempty"` 10085 // ID - READ-ONLY; Fully qualified resource ID for the resource. 10086 ID *string `json:"id,omitempty"` 10087 // Name - READ-ONLY; The name of the resource. 10088 Name *string `json:"name,omitempty"` 10089 // Type - READ-ONLY; The type of the resource. 10090 Type *string `json:"type,omitempty"` 10091} 10092 10093// MarshalJSON is the custom marshaler for SubscriptionMediaService. 10094func (sms SubscriptionMediaService) MarshalJSON() ([]byte, error) { 10095 objectMap := make(map[string]interface{}) 10096 if sms.ServiceProperties != nil { 10097 objectMap["properties"] = sms.ServiceProperties 10098 } 10099 if sms.Tags != nil { 10100 objectMap["tags"] = sms.Tags 10101 } 10102 if sms.Location != nil { 10103 objectMap["location"] = sms.Location 10104 } 10105 return json.Marshal(objectMap) 10106} 10107 10108// UnmarshalJSON is the custom unmarshaler for SubscriptionMediaService struct. 10109func (sms *SubscriptionMediaService) UnmarshalJSON(body []byte) error { 10110 var m map[string]*json.RawMessage 10111 err := json.Unmarshal(body, &m) 10112 if err != nil { 10113 return err 10114 } 10115 for k, v := range m { 10116 switch k { 10117 case "properties": 10118 if v != nil { 10119 var serviceProperties ServiceProperties 10120 err = json.Unmarshal(*v, &serviceProperties) 10121 if err != nil { 10122 return err 10123 } 10124 sms.ServiceProperties = &serviceProperties 10125 } 10126 case "tags": 10127 if v != nil { 10128 var tags map[string]*string 10129 err = json.Unmarshal(*v, &tags) 10130 if err != nil { 10131 return err 10132 } 10133 sms.Tags = tags 10134 } 10135 case "location": 10136 if v != nil { 10137 var location string 10138 err = json.Unmarshal(*v, &location) 10139 if err != nil { 10140 return err 10141 } 10142 sms.Location = &location 10143 } 10144 case "id": 10145 if v != nil { 10146 var ID string 10147 err = json.Unmarshal(*v, &ID) 10148 if err != nil { 10149 return err 10150 } 10151 sms.ID = &ID 10152 } 10153 case "name": 10154 if v != nil { 10155 var name string 10156 err = json.Unmarshal(*v, &name) 10157 if err != nil { 10158 return err 10159 } 10160 sms.Name = &name 10161 } 10162 case "type": 10163 if v != nil { 10164 var typeVar string 10165 err = json.Unmarshal(*v, &typeVar) 10166 if err != nil { 10167 return err 10168 } 10169 sms.Type = &typeVar 10170 } 10171 } 10172 } 10173 10174 return nil 10175} 10176 10177// SubscriptionMediaServiceCollection a collection of SubscriptionMediaService items. 10178type SubscriptionMediaServiceCollection struct { 10179 autorest.Response `json:"-"` 10180 // Value - A collection of SubscriptionMediaService items. 10181 Value *[]SubscriptionMediaService `json:"value,omitempty"` 10182 // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). 10183 OdataNextLink *string `json:"@odata.nextLink,omitempty"` 10184} 10185 10186// SubscriptionMediaServiceCollectionIterator provides access to a complete listing of 10187// SubscriptionMediaService values. 10188type SubscriptionMediaServiceCollectionIterator struct { 10189 i int 10190 page SubscriptionMediaServiceCollectionPage 10191} 10192 10193// NextWithContext advances to the next value. If there was an error making 10194// the request the iterator does not advance and the error is returned. 10195func (iter *SubscriptionMediaServiceCollectionIterator) NextWithContext(ctx context.Context) (err error) { 10196 if tracing.IsEnabled() { 10197 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionMediaServiceCollectionIterator.NextWithContext") 10198 defer func() { 10199 sc := -1 10200 if iter.Response().Response.Response != nil { 10201 sc = iter.Response().Response.Response.StatusCode 10202 } 10203 tracing.EndSpan(ctx, sc, err) 10204 }() 10205 } 10206 iter.i++ 10207 if iter.i < len(iter.page.Values()) { 10208 return nil 10209 } 10210 err = iter.page.NextWithContext(ctx) 10211 if err != nil { 10212 iter.i-- 10213 return err 10214 } 10215 iter.i = 0 10216 return nil 10217} 10218 10219// Next advances to the next value. If there was an error making 10220// the request the iterator does not advance and the error is returned. 10221// Deprecated: Use NextWithContext() instead. 10222func (iter *SubscriptionMediaServiceCollectionIterator) Next() error { 10223 return iter.NextWithContext(context.Background()) 10224} 10225 10226// NotDone returns true if the enumeration should be started or is not yet complete. 10227func (iter SubscriptionMediaServiceCollectionIterator) NotDone() bool { 10228 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10229} 10230 10231// Response returns the raw server response from the last page request. 10232func (iter SubscriptionMediaServiceCollectionIterator) Response() SubscriptionMediaServiceCollection { 10233 return iter.page.Response() 10234} 10235 10236// Value returns the current value or a zero-initialized value if the 10237// iterator has advanced beyond the end of the collection. 10238func (iter SubscriptionMediaServiceCollectionIterator) Value() SubscriptionMediaService { 10239 if !iter.page.NotDone() { 10240 return SubscriptionMediaService{} 10241 } 10242 return iter.page.Values()[iter.i] 10243} 10244 10245// Creates a new instance of the SubscriptionMediaServiceCollectionIterator type. 10246func NewSubscriptionMediaServiceCollectionIterator(page SubscriptionMediaServiceCollectionPage) SubscriptionMediaServiceCollectionIterator { 10247 return SubscriptionMediaServiceCollectionIterator{page: page} 10248} 10249 10250// IsEmpty returns true if the ListResult contains no values. 10251func (smsc SubscriptionMediaServiceCollection) IsEmpty() bool { 10252 return smsc.Value == nil || len(*smsc.Value) == 0 10253} 10254 10255// subscriptionMediaServiceCollectionPreparer prepares a request to retrieve the next set of results. 10256// It returns nil if no more results exist. 10257func (smsc SubscriptionMediaServiceCollection) subscriptionMediaServiceCollectionPreparer(ctx context.Context) (*http.Request, error) { 10258 if smsc.OdataNextLink == nil || len(to.String(smsc.OdataNextLink)) < 1 { 10259 return nil, nil 10260 } 10261 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10262 autorest.AsJSON(), 10263 autorest.AsGet(), 10264 autorest.WithBaseURL(to.String(smsc.OdataNextLink))) 10265} 10266 10267// SubscriptionMediaServiceCollectionPage contains a page of SubscriptionMediaService values. 10268type SubscriptionMediaServiceCollectionPage struct { 10269 fn func(context.Context, SubscriptionMediaServiceCollection) (SubscriptionMediaServiceCollection, error) 10270 smsc SubscriptionMediaServiceCollection 10271} 10272 10273// NextWithContext advances to the next page of values. If there was an error making 10274// the request the page does not advance and the error is returned. 10275func (page *SubscriptionMediaServiceCollectionPage) NextWithContext(ctx context.Context) (err error) { 10276 if tracing.IsEnabled() { 10277 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionMediaServiceCollectionPage.NextWithContext") 10278 defer func() { 10279 sc := -1 10280 if page.Response().Response.Response != nil { 10281 sc = page.Response().Response.Response.StatusCode 10282 } 10283 tracing.EndSpan(ctx, sc, err) 10284 }() 10285 } 10286 next, err := page.fn(ctx, page.smsc) 10287 if err != nil { 10288 return err 10289 } 10290 page.smsc = next 10291 return nil 10292} 10293 10294// Next advances to the next page of values. If there was an error making 10295// the request the page does not advance and the error is returned. 10296// Deprecated: Use NextWithContext() instead. 10297func (page *SubscriptionMediaServiceCollectionPage) Next() error { 10298 return page.NextWithContext(context.Background()) 10299} 10300 10301// NotDone returns true if the page enumeration should be started or is not yet complete. 10302func (page SubscriptionMediaServiceCollectionPage) NotDone() bool { 10303 return !page.smsc.IsEmpty() 10304} 10305 10306// Response returns the raw server response from the last page request. 10307func (page SubscriptionMediaServiceCollectionPage) Response() SubscriptionMediaServiceCollection { 10308 return page.smsc 10309} 10310 10311// Values returns the slice of values for the current page or nil if there are no values. 10312func (page SubscriptionMediaServiceCollectionPage) Values() []SubscriptionMediaService { 10313 if page.smsc.IsEmpty() { 10314 return nil 10315 } 10316 return *page.smsc.Value 10317} 10318 10319// Creates a new instance of the SubscriptionMediaServiceCollectionPage type. 10320func NewSubscriptionMediaServiceCollectionPage(getNextPage func(context.Context, SubscriptionMediaServiceCollection) (SubscriptionMediaServiceCollection, error)) SubscriptionMediaServiceCollectionPage { 10321 return SubscriptionMediaServiceCollectionPage{fn: getNextPage} 10322} 10323 10324// SyncStorageKeysInput the input to the sync storage keys request. 10325type SyncStorageKeysInput struct { 10326 // ID - The ID of the storage account resource. 10327 ID *string `json:"id,omitempty"` 10328} 10329 10330// TrackedResource the resource model definition for a ARM tracked resource. 10331type TrackedResource struct { 10332 // Tags - Resource tags. 10333 Tags map[string]*string `json:"tags"` 10334 // Location - The Azure Region of the resource. 10335 Location *string `json:"location,omitempty"` 10336 // ID - READ-ONLY; Fully qualified resource ID for the resource. 10337 ID *string `json:"id,omitempty"` 10338 // Name - READ-ONLY; The name of the resource. 10339 Name *string `json:"name,omitempty"` 10340 // Type - READ-ONLY; The type of the resource. 10341 Type *string `json:"type,omitempty"` 10342} 10343 10344// MarshalJSON is the custom marshaler for TrackedResource. 10345func (tr TrackedResource) MarshalJSON() ([]byte, error) { 10346 objectMap := make(map[string]interface{}) 10347 if tr.Tags != nil { 10348 objectMap["tags"] = tr.Tags 10349 } 10350 if tr.Location != nil { 10351 objectMap["location"] = tr.Location 10352 } 10353 return json.Marshal(objectMap) 10354} 10355 10356// TrackPropertyCondition class to specify one track property condition 10357type TrackPropertyCondition struct { 10358 // Property - Track property type. Possible values include: 'TrackPropertyTypeUnknown', 'TrackPropertyTypeFourCC' 10359 Property TrackPropertyType `json:"property,omitempty"` 10360 // Operation - Track property condition operation. Possible values include: 'TrackPropertyCompareOperationUnknown', 'TrackPropertyCompareOperationEqual' 10361 Operation TrackPropertyCompareOperation `json:"operation,omitempty"` 10362 // Value - Track property value 10363 Value *string `json:"value,omitempty"` 10364} 10365 10366// TrackSelection class to select a track 10367type TrackSelection struct { 10368 // TrackSelections - TrackSelections is a track property condition list which can specify track(s) 10369 TrackSelections *[]TrackPropertyCondition `json:"trackSelections,omitempty"` 10370} 10371 10372// Transform a Transform encapsulates the rules or instructions for generating desired outputs from input 10373// media, such as by transcoding or by extracting insights. After the Transform is created, it can be 10374// applied to input media by creating Jobs. 10375type Transform struct { 10376 autorest.Response `json:"-"` 10377 // TransformProperties - The resource properties. 10378 *TransformProperties `json:"properties,omitempty"` 10379 // ID - READ-ONLY; Fully qualified resource ID for the resource. 10380 ID *string `json:"id,omitempty"` 10381 // Name - READ-ONLY; The name of the resource. 10382 Name *string `json:"name,omitempty"` 10383 // Type - READ-ONLY; The type of the resource. 10384 Type *string `json:"type,omitempty"` 10385} 10386 10387// MarshalJSON is the custom marshaler for Transform. 10388func (t Transform) MarshalJSON() ([]byte, error) { 10389 objectMap := make(map[string]interface{}) 10390 if t.TransformProperties != nil { 10391 objectMap["properties"] = t.TransformProperties 10392 } 10393 return json.Marshal(objectMap) 10394} 10395 10396// UnmarshalJSON is the custom unmarshaler for Transform struct. 10397func (t *Transform) UnmarshalJSON(body []byte) error { 10398 var m map[string]*json.RawMessage 10399 err := json.Unmarshal(body, &m) 10400 if err != nil { 10401 return err 10402 } 10403 for k, v := range m { 10404 switch k { 10405 case "properties": 10406 if v != nil { 10407 var transformProperties TransformProperties 10408 err = json.Unmarshal(*v, &transformProperties) 10409 if err != nil { 10410 return err 10411 } 10412 t.TransformProperties = &transformProperties 10413 } 10414 case "id": 10415 if v != nil { 10416 var ID string 10417 err = json.Unmarshal(*v, &ID) 10418 if err != nil { 10419 return err 10420 } 10421 t.ID = &ID 10422 } 10423 case "name": 10424 if v != nil { 10425 var name string 10426 err = json.Unmarshal(*v, &name) 10427 if err != nil { 10428 return err 10429 } 10430 t.Name = &name 10431 } 10432 case "type": 10433 if v != nil { 10434 var typeVar string 10435 err = json.Unmarshal(*v, &typeVar) 10436 if err != nil { 10437 return err 10438 } 10439 t.Type = &typeVar 10440 } 10441 } 10442 } 10443 10444 return nil 10445} 10446 10447// TransformCollection a collection of Transform items. 10448type TransformCollection struct { 10449 autorest.Response `json:"-"` 10450 // Value - A collection of Transform items. 10451 Value *[]Transform `json:"value,omitempty"` 10452 // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). 10453 OdataNextLink *string `json:"@odata.nextLink,omitempty"` 10454} 10455 10456// TransformCollectionIterator provides access to a complete listing of Transform values. 10457type TransformCollectionIterator struct { 10458 i int 10459 page TransformCollectionPage 10460} 10461 10462// NextWithContext advances to the next value. If there was an error making 10463// the request the iterator does not advance and the error is returned. 10464func (iter *TransformCollectionIterator) NextWithContext(ctx context.Context) (err error) { 10465 if tracing.IsEnabled() { 10466 ctx = tracing.StartSpan(ctx, fqdn+"/TransformCollectionIterator.NextWithContext") 10467 defer func() { 10468 sc := -1 10469 if iter.Response().Response.Response != nil { 10470 sc = iter.Response().Response.Response.StatusCode 10471 } 10472 tracing.EndSpan(ctx, sc, err) 10473 }() 10474 } 10475 iter.i++ 10476 if iter.i < len(iter.page.Values()) { 10477 return nil 10478 } 10479 err = iter.page.NextWithContext(ctx) 10480 if err != nil { 10481 iter.i-- 10482 return err 10483 } 10484 iter.i = 0 10485 return nil 10486} 10487 10488// Next advances to the next value. If there was an error making 10489// the request the iterator does not advance and the error is returned. 10490// Deprecated: Use NextWithContext() instead. 10491func (iter *TransformCollectionIterator) Next() error { 10492 return iter.NextWithContext(context.Background()) 10493} 10494 10495// NotDone returns true if the enumeration should be started or is not yet complete. 10496func (iter TransformCollectionIterator) NotDone() bool { 10497 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10498} 10499 10500// Response returns the raw server response from the last page request. 10501func (iter TransformCollectionIterator) Response() TransformCollection { 10502 return iter.page.Response() 10503} 10504 10505// Value returns the current value or a zero-initialized value if the 10506// iterator has advanced beyond the end of the collection. 10507func (iter TransformCollectionIterator) Value() Transform { 10508 if !iter.page.NotDone() { 10509 return Transform{} 10510 } 10511 return iter.page.Values()[iter.i] 10512} 10513 10514// Creates a new instance of the TransformCollectionIterator type. 10515func NewTransformCollectionIterator(page TransformCollectionPage) TransformCollectionIterator { 10516 return TransformCollectionIterator{page: page} 10517} 10518 10519// IsEmpty returns true if the ListResult contains no values. 10520func (tc TransformCollection) IsEmpty() bool { 10521 return tc.Value == nil || len(*tc.Value) == 0 10522} 10523 10524// transformCollectionPreparer prepares a request to retrieve the next set of results. 10525// It returns nil if no more results exist. 10526func (tc TransformCollection) transformCollectionPreparer(ctx context.Context) (*http.Request, error) { 10527 if tc.OdataNextLink == nil || len(to.String(tc.OdataNextLink)) < 1 { 10528 return nil, nil 10529 } 10530 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10531 autorest.AsJSON(), 10532 autorest.AsGet(), 10533 autorest.WithBaseURL(to.String(tc.OdataNextLink))) 10534} 10535 10536// TransformCollectionPage contains a page of Transform values. 10537type TransformCollectionPage struct { 10538 fn func(context.Context, TransformCollection) (TransformCollection, error) 10539 tc TransformCollection 10540} 10541 10542// NextWithContext advances to the next page of values. If there was an error making 10543// the request the page does not advance and the error is returned. 10544func (page *TransformCollectionPage) NextWithContext(ctx context.Context) (err error) { 10545 if tracing.IsEnabled() { 10546 ctx = tracing.StartSpan(ctx, fqdn+"/TransformCollectionPage.NextWithContext") 10547 defer func() { 10548 sc := -1 10549 if page.Response().Response.Response != nil { 10550 sc = page.Response().Response.Response.StatusCode 10551 } 10552 tracing.EndSpan(ctx, sc, err) 10553 }() 10554 } 10555 next, err := page.fn(ctx, page.tc) 10556 if err != nil { 10557 return err 10558 } 10559 page.tc = next 10560 return nil 10561} 10562 10563// Next advances to the next page of values. If there was an error making 10564// the request the page does not advance and the error is returned. 10565// Deprecated: Use NextWithContext() instead. 10566func (page *TransformCollectionPage) Next() error { 10567 return page.NextWithContext(context.Background()) 10568} 10569 10570// NotDone returns true if the page enumeration should be started or is not yet complete. 10571func (page TransformCollectionPage) NotDone() bool { 10572 return !page.tc.IsEmpty() 10573} 10574 10575// Response returns the raw server response from the last page request. 10576func (page TransformCollectionPage) Response() TransformCollection { 10577 return page.tc 10578} 10579 10580// Values returns the slice of values for the current page or nil if there are no values. 10581func (page TransformCollectionPage) Values() []Transform { 10582 if page.tc.IsEmpty() { 10583 return nil 10584 } 10585 return *page.tc.Value 10586} 10587 10588// Creates a new instance of the TransformCollectionPage type. 10589func NewTransformCollectionPage(getNextPage func(context.Context, TransformCollection) (TransformCollection, error)) TransformCollectionPage { 10590 return TransformCollectionPage{fn: getNextPage} 10591} 10592 10593// TransformOutput describes the properties of a TransformOutput, which are the rules to be applied while 10594// generating the desired output. 10595type TransformOutput struct { 10596 // OnError - A Transform can define more than one outputs. This property defines what the service should do when one output fails - either continue to produce other outputs, or, stop the other outputs. The overall Job state will not reflect failures of outputs that are specified with 'ContinueJob'. The default is 'StopProcessingJob'. Possible values include: 'StopProcessingJob', 'ContinueJob' 10597 OnError OnErrorType `json:"onError,omitempty"` 10598 // RelativePriority - Sets the relative priority of the TransformOutputs within a Transform. This sets the priority that the service uses for processing TransformOutputs. The default priority is Normal. Possible values include: 'Low', 'Normal', 'High' 10599 RelativePriority Priority `json:"relativePriority,omitempty"` 10600 // Preset - Preset that describes the operations that will be used to modify, transcode, or extract insights from the source file to generate the output. 10601 Preset BasicPreset `json:"preset,omitempty"` 10602} 10603 10604// UnmarshalJSON is the custom unmarshaler for TransformOutput struct. 10605func (toVar *TransformOutput) UnmarshalJSON(body []byte) error { 10606 var m map[string]*json.RawMessage 10607 err := json.Unmarshal(body, &m) 10608 if err != nil { 10609 return err 10610 } 10611 for k, v := range m { 10612 switch k { 10613 case "onError": 10614 if v != nil { 10615 var onError OnErrorType 10616 err = json.Unmarshal(*v, &onError) 10617 if err != nil { 10618 return err 10619 } 10620 toVar.OnError = onError 10621 } 10622 case "relativePriority": 10623 if v != nil { 10624 var relativePriority Priority 10625 err = json.Unmarshal(*v, &relativePriority) 10626 if err != nil { 10627 return err 10628 } 10629 toVar.RelativePriority = relativePriority 10630 } 10631 case "preset": 10632 if v != nil { 10633 preset, err := unmarshalBasicPreset(*v) 10634 if err != nil { 10635 return err 10636 } 10637 toVar.Preset = preset 10638 } 10639 } 10640 } 10641 10642 return nil 10643} 10644 10645// TransformProperties a Transform. 10646type TransformProperties struct { 10647 // Created - READ-ONLY; The UTC date and time when the Transform was created, in 'YYYY-MM-DDThh:mm:ssZ' format. 10648 Created *date.Time `json:"created,omitempty"` 10649 // Description - An optional verbose description of the Transform. 10650 Description *string `json:"description,omitempty"` 10651 // LastModified - READ-ONLY; The UTC date and time when the Transform was last updated, in 'YYYY-MM-DDThh:mm:ssZ' format. 10652 LastModified *date.Time `json:"lastModified,omitempty"` 10653 // Outputs - An array of one or more TransformOutputs that the Transform should generate. 10654 Outputs *[]TransformOutput `json:"outputs,omitempty"` 10655} 10656 10657// TransportStreamFormat describes the properties for generating an MPEG-2 Transport Stream (ISO/IEC 10658// 13818-1) output video file(s). 10659type TransportStreamFormat struct { 10660 // OutputFiles - The list of output files to produce. Each entry in the list is a set of audio and video layer labels to be muxed together . 10661 OutputFiles *[]OutputFile `json:"outputFiles,omitempty"` 10662 // FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. 10663 FilenamePattern *string `json:"filenamePattern,omitempty"` 10664 // OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat' 10665 OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"` 10666} 10667 10668// MarshalJSON is the custom marshaler for TransportStreamFormat. 10669func (tsf TransportStreamFormat) MarshalJSON() ([]byte, error) { 10670 tsf.OdataType = OdataTypeMicrosoftMediaTransportStreamFormat 10671 objectMap := make(map[string]interface{}) 10672 if tsf.OutputFiles != nil { 10673 objectMap["outputFiles"] = tsf.OutputFiles 10674 } 10675 if tsf.FilenamePattern != nil { 10676 objectMap["filenamePattern"] = tsf.FilenamePattern 10677 } 10678 if tsf.OdataType != "" { 10679 objectMap["@odata.type"] = tsf.OdataType 10680 } 10681 return json.Marshal(objectMap) 10682} 10683 10684// AsImageFormat is the BasicFormat implementation for TransportStreamFormat. 10685func (tsf TransportStreamFormat) AsImageFormat() (*ImageFormat, bool) { 10686 return nil, false 10687} 10688 10689// AsBasicImageFormat is the BasicFormat implementation for TransportStreamFormat. 10690func (tsf TransportStreamFormat) AsBasicImageFormat() (BasicImageFormat, bool) { 10691 return nil, false 10692} 10693 10694// AsJpgFormat is the BasicFormat implementation for TransportStreamFormat. 10695func (tsf TransportStreamFormat) AsJpgFormat() (*JpgFormat, bool) { 10696 return nil, false 10697} 10698 10699// AsPngFormat is the BasicFormat implementation for TransportStreamFormat. 10700func (tsf TransportStreamFormat) AsPngFormat() (*PngFormat, bool) { 10701 return nil, false 10702} 10703 10704// AsMultiBitrateFormat is the BasicFormat implementation for TransportStreamFormat. 10705func (tsf TransportStreamFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) { 10706 return nil, false 10707} 10708 10709// AsBasicMultiBitrateFormat is the BasicFormat implementation for TransportStreamFormat. 10710func (tsf TransportStreamFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) { 10711 return &tsf, true 10712} 10713 10714// AsMp4Format is the BasicFormat implementation for TransportStreamFormat. 10715func (tsf TransportStreamFormat) AsMp4Format() (*Mp4Format, bool) { 10716 return nil, false 10717} 10718 10719// AsTransportStreamFormat is the BasicFormat implementation for TransportStreamFormat. 10720func (tsf TransportStreamFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) { 10721 return &tsf, true 10722} 10723 10724// AsFormat is the BasicFormat implementation for TransportStreamFormat. 10725func (tsf TransportStreamFormat) AsFormat() (*Format, bool) { 10726 return nil, false 10727} 10728 10729// AsBasicFormat is the BasicFormat implementation for TransportStreamFormat. 10730func (tsf TransportStreamFormat) AsBasicFormat() (BasicFormat, bool) { 10731 return &tsf, true 10732} 10733 10734// BasicVideo describes the basic properties for encoding the input video. 10735type BasicVideo interface { 10736 AsImage() (*Image, bool) 10737 AsBasicImage() (BasicImage, bool) 10738 AsH264Video() (*H264Video, bool) 10739 AsJpgImage() (*JpgImage, bool) 10740 AsPngImage() (*PngImage, bool) 10741 AsVideo() (*Video, bool) 10742} 10743 10744// Video describes the basic properties for encoding the input video. 10745type Video struct { 10746 // KeyFrameInterval - The distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). 10747 KeyFrameInterval *string `json:"keyFrameInterval,omitempty"` 10748 // StretchMode - The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit' 10749 StretchMode StretchMode `json:"stretchMode,omitempty"` 10750 // Label - An optional label for the codec. The label can be used to control muxing behavior. 10751 Label *string `json:"label,omitempty"` 10752 // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' 10753 OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` 10754} 10755 10756func unmarshalBasicVideo(body []byte) (BasicVideo, error) { 10757 var m map[string]interface{} 10758 err := json.Unmarshal(body, &m) 10759 if err != nil { 10760 return nil, err 10761 } 10762 10763 switch m["@odata.type"] { 10764 case string(OdataTypeMicrosoftMediaImage): 10765 var i Image 10766 err := json.Unmarshal(body, &i) 10767 return i, err 10768 case string(OdataTypeMicrosoftMediaH264Video): 10769 var hv H264Video 10770 err := json.Unmarshal(body, &hv) 10771 return hv, err 10772 case string(OdataTypeMicrosoftMediaJpgImage): 10773 var ji JpgImage 10774 err := json.Unmarshal(body, &ji) 10775 return ji, err 10776 case string(OdataTypeMicrosoftMediaPngImage): 10777 var pi PngImage 10778 err := json.Unmarshal(body, &pi) 10779 return pi, err 10780 default: 10781 var vVar Video 10782 err := json.Unmarshal(body, &vVar) 10783 return vVar, err 10784 } 10785} 10786func unmarshalBasicVideoArray(body []byte) ([]BasicVideo, error) { 10787 var rawMessages []*json.RawMessage 10788 err := json.Unmarshal(body, &rawMessages) 10789 if err != nil { 10790 return nil, err 10791 } 10792 10793 vVarArray := make([]BasicVideo, len(rawMessages)) 10794 10795 for index, rawMessage := range rawMessages { 10796 vVar, err := unmarshalBasicVideo(*rawMessage) 10797 if err != nil { 10798 return nil, err 10799 } 10800 vVarArray[index] = vVar 10801 } 10802 return vVarArray, nil 10803} 10804 10805// MarshalJSON is the custom marshaler for Video. 10806func (vVar Video) MarshalJSON() ([]byte, error) { 10807 vVar.OdataType = OdataTypeMicrosoftMediaVideo 10808 objectMap := make(map[string]interface{}) 10809 if vVar.KeyFrameInterval != nil { 10810 objectMap["keyFrameInterval"] = vVar.KeyFrameInterval 10811 } 10812 if vVar.StretchMode != "" { 10813 objectMap["stretchMode"] = vVar.StretchMode 10814 } 10815 if vVar.Label != nil { 10816 objectMap["label"] = vVar.Label 10817 } 10818 if vVar.OdataType != "" { 10819 objectMap["@odata.type"] = vVar.OdataType 10820 } 10821 return json.Marshal(objectMap) 10822} 10823 10824// AsAudio is the BasicCodec implementation for Video. 10825func (vVar Video) AsAudio() (*Audio, bool) { 10826 return nil, false 10827} 10828 10829// AsBasicAudio is the BasicCodec implementation for Video. 10830func (vVar Video) AsBasicAudio() (BasicAudio, bool) { 10831 return nil, false 10832} 10833 10834// AsAacAudio is the BasicCodec implementation for Video. 10835func (vVar Video) AsAacAudio() (*AacAudio, bool) { 10836 return nil, false 10837} 10838 10839// AsCopyVideo is the BasicCodec implementation for Video. 10840func (vVar Video) AsCopyVideo() (*CopyVideo, bool) { 10841 return nil, false 10842} 10843 10844// AsVideo is the BasicCodec implementation for Video. 10845func (vVar Video) AsVideo() (*Video, bool) { 10846 return &vVar, true 10847} 10848 10849// AsBasicVideo is the BasicCodec implementation for Video. 10850func (vVar Video) AsBasicVideo() (BasicVideo, bool) { 10851 return &vVar, true 10852} 10853 10854// AsImage is the BasicCodec implementation for Video. 10855func (vVar Video) AsImage() (*Image, bool) { 10856 return nil, false 10857} 10858 10859// AsBasicImage is the BasicCodec implementation for Video. 10860func (vVar Video) AsBasicImage() (BasicImage, bool) { 10861 return nil, false 10862} 10863 10864// AsCopyAudio is the BasicCodec implementation for Video. 10865func (vVar Video) AsCopyAudio() (*CopyAudio, bool) { 10866 return nil, false 10867} 10868 10869// AsH264Video is the BasicCodec implementation for Video. 10870func (vVar Video) AsH264Video() (*H264Video, bool) { 10871 return nil, false 10872} 10873 10874// AsJpgImage is the BasicCodec implementation for Video. 10875func (vVar Video) AsJpgImage() (*JpgImage, bool) { 10876 return nil, false 10877} 10878 10879// AsPngImage is the BasicCodec implementation for Video. 10880func (vVar Video) AsPngImage() (*PngImage, bool) { 10881 return nil, false 10882} 10883 10884// AsCodec is the BasicCodec implementation for Video. 10885func (vVar Video) AsCodec() (*Codec, bool) { 10886 return nil, false 10887} 10888 10889// AsBasicCodec is the BasicCodec implementation for Video. 10890func (vVar Video) AsBasicCodec() (BasicCodec, bool) { 10891 return &vVar, true 10892} 10893 10894// VideoAnalyzerPreset a video analyzer preset that extracts insights (rich metadata) from both audio and 10895// video, and outputs a JSON format file. 10896type VideoAnalyzerPreset struct { 10897 // InsightsToExtract - Defines the type of insights that you want the service to generate. The allowed values are 'AudioInsightsOnly', 'VideoInsightsOnly', and 'AllInsights'. The default is AllInsights. If you set this to AllInsights and the input is audio only, then only audio insights are generated. Similarly if the input is video only, then only video insights are generated. It is recommended that you not use AudioInsightsOnly if you expect some of your inputs to be video only; or use VideoInsightsOnly if you expect some of your inputs to be audio only. Your Jobs in such conditions would error out. Possible values include: 'AudioInsightsOnly', 'VideoInsightsOnly', 'AllInsights' 10898 InsightsToExtract InsightsType `json:"insightsToExtract,omitempty"` 10899 // AudioLanguage - The language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). The list of supported languages are English ('en-US' and 'en-GB'), Spanish ('es-ES' and 'es-MX'), French ('fr-FR'), Italian ('it-IT'), Japanese ('ja-JP'), Portuguese ('pt-BR'), Chinese ('zh-CN'), German ('de-DE'), Arabic ('ar-EG' and 'ar-SY'), Russian ('ru-RU'), Hindi ('hi-IN'), and Korean ('ko-KR'). If you know the language of your content, it is recommended that you specify it. If the language isn't specified or set to null, automatic language detection will choose the first language detected and process with the selected language for the duration of the file. This language detection feature currently supports English, Chinese, French, German, Italian, Japanese, Spanish, Russian, and Portuguese. It does not currently support dynamically switching between languages after the first language is detected. The automatic detection works best with audio recordings with clearly discernable speech. If automatic detection fails to find the language, transcription would fallback to 'en-US'." 10900 AudioLanguage *string `json:"audioLanguage,omitempty"` 10901 // OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset' 10902 OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"` 10903} 10904 10905// MarshalJSON is the custom marshaler for VideoAnalyzerPreset. 10906func (vap VideoAnalyzerPreset) MarshalJSON() ([]byte, error) { 10907 vap.OdataType = OdataTypeMicrosoftMediaVideoAnalyzerPreset 10908 objectMap := make(map[string]interface{}) 10909 if vap.InsightsToExtract != "" { 10910 objectMap["insightsToExtract"] = vap.InsightsToExtract 10911 } 10912 if vap.AudioLanguage != nil { 10913 objectMap["audioLanguage"] = vap.AudioLanguage 10914 } 10915 if vap.OdataType != "" { 10916 objectMap["@odata.type"] = vap.OdataType 10917 } 10918 return json.Marshal(objectMap) 10919} 10920 10921// AsFaceDetectorPreset is the BasicPreset implementation for VideoAnalyzerPreset. 10922func (vap VideoAnalyzerPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) { 10923 return nil, false 10924} 10925 10926// AsAudioAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset. 10927func (vap VideoAnalyzerPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) { 10928 return nil, false 10929} 10930 10931// AsBasicAudioAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset. 10932func (vap VideoAnalyzerPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) { 10933 return &vap, true 10934} 10935 10936// AsBuiltInStandardEncoderPreset is the BasicPreset implementation for VideoAnalyzerPreset. 10937func (vap VideoAnalyzerPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) { 10938 return nil, false 10939} 10940 10941// AsStandardEncoderPreset is the BasicPreset implementation for VideoAnalyzerPreset. 10942func (vap VideoAnalyzerPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) { 10943 return nil, false 10944} 10945 10946// AsVideoAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset. 10947func (vap VideoAnalyzerPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) { 10948 return &vap, true 10949} 10950 10951// AsPreset is the BasicPreset implementation for VideoAnalyzerPreset. 10952func (vap VideoAnalyzerPreset) AsPreset() (*Preset, bool) { 10953 return nil, false 10954} 10955 10956// AsBasicPreset is the BasicPreset implementation for VideoAnalyzerPreset. 10957func (vap VideoAnalyzerPreset) AsBasicPreset() (BasicPreset, bool) { 10958 return &vap, true 10959} 10960 10961// BasicVideoLayer describes the settings to be used when encoding the input video into a desired output bitrate layer. 10962type BasicVideoLayer interface { 10963 AsH264Layer() (*H264Layer, bool) 10964 AsVideoLayer() (*VideoLayer, bool) 10965} 10966 10967// VideoLayer describes the settings to be used when encoding the input video into a desired output bitrate 10968// layer. 10969type VideoLayer struct { 10970 // Bitrate - The average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field. 10971 Bitrate *int32 `json:"bitrate,omitempty"` 10972 // MaxBitrate - The maximum bitrate (in bits per second), at which the VBV buffer should be assumed to refill. If not specified, defaults to the same value as bitrate. 10973 MaxBitrate *int32 `json:"maxBitrate,omitempty"` 10974 // BFrames - The number of B-frames to be used when encoding this layer. If not specified, the encoder chooses an appropriate number based on the video profile and level. 10975 BFrames *int32 `json:"bFrames,omitempty"` 10976 // FrameRate - The frame rate (in frames per second) at which to encode this layer. The value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame rates based on the profile and level. If it is not specified, the encoder will use the same frame rate as the input video. 10977 FrameRate *string `json:"frameRate,omitempty"` 10978 // Slices - The number of slices to be used when encoding this layer. If not specified, default is zero, which means that encoder will use a single slice for each frame. 10979 Slices *int32 `json:"slices,omitempty"` 10980 // AdaptiveBFrame - Whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use. 10981 AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"` 10982 // Width - The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. 10983 Width *string `json:"width,omitempty"` 10984 // Height - The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. 10985 Height *string `json:"height,omitempty"` 10986 // Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file. 10987 Label *string `json:"label,omitempty"` 10988 // OdataType - Possible values include: 'OdataTypeLayer', 'OdataTypeMicrosoftMediaVideoLayer', 'OdataTypeMicrosoftMediaH264Layer', 'OdataTypeMicrosoftMediaJpgLayer', 'OdataTypeMicrosoftMediaPngLayer' 10989 OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"` 10990} 10991 10992func unmarshalBasicVideoLayer(body []byte) (BasicVideoLayer, error) { 10993 var m map[string]interface{} 10994 err := json.Unmarshal(body, &m) 10995 if err != nil { 10996 return nil, err 10997 } 10998 10999 switch m["@odata.type"] { 11000 case string(OdataTypeMicrosoftMediaH264Layer): 11001 var hl H264Layer 11002 err := json.Unmarshal(body, &hl) 11003 return hl, err 11004 default: 11005 var vl VideoLayer 11006 err := json.Unmarshal(body, &vl) 11007 return vl, err 11008 } 11009} 11010func unmarshalBasicVideoLayerArray(body []byte) ([]BasicVideoLayer, error) { 11011 var rawMessages []*json.RawMessage 11012 err := json.Unmarshal(body, &rawMessages) 11013 if err != nil { 11014 return nil, err 11015 } 11016 11017 vlArray := make([]BasicVideoLayer, len(rawMessages)) 11018 11019 for index, rawMessage := range rawMessages { 11020 vl, err := unmarshalBasicVideoLayer(*rawMessage) 11021 if err != nil { 11022 return nil, err 11023 } 11024 vlArray[index] = vl 11025 } 11026 return vlArray, nil 11027} 11028 11029// MarshalJSON is the custom marshaler for VideoLayer. 11030func (vl VideoLayer) MarshalJSON() ([]byte, error) { 11031 vl.OdataType = OdataTypeMicrosoftMediaVideoLayer 11032 objectMap := make(map[string]interface{}) 11033 if vl.Bitrate != nil { 11034 objectMap["bitrate"] = vl.Bitrate 11035 } 11036 if vl.MaxBitrate != nil { 11037 objectMap["maxBitrate"] = vl.MaxBitrate 11038 } 11039 if vl.BFrames != nil { 11040 objectMap["bFrames"] = vl.BFrames 11041 } 11042 if vl.FrameRate != nil { 11043 objectMap["frameRate"] = vl.FrameRate 11044 } 11045 if vl.Slices != nil { 11046 objectMap["slices"] = vl.Slices 11047 } 11048 if vl.AdaptiveBFrame != nil { 11049 objectMap["adaptiveBFrame"] = vl.AdaptiveBFrame 11050 } 11051 if vl.Width != nil { 11052 objectMap["width"] = vl.Width 11053 } 11054 if vl.Height != nil { 11055 objectMap["height"] = vl.Height 11056 } 11057 if vl.Label != nil { 11058 objectMap["label"] = vl.Label 11059 } 11060 if vl.OdataType != "" { 11061 objectMap["@odata.type"] = vl.OdataType 11062 } 11063 return json.Marshal(objectMap) 11064} 11065 11066// AsVideoLayer is the BasicLayer implementation for VideoLayer. 11067func (vl VideoLayer) AsVideoLayer() (*VideoLayer, bool) { 11068 return &vl, true 11069} 11070 11071// AsBasicVideoLayer is the BasicLayer implementation for VideoLayer. 11072func (vl VideoLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) { 11073 return &vl, true 11074} 11075 11076// AsH264Layer is the BasicLayer implementation for VideoLayer. 11077func (vl VideoLayer) AsH264Layer() (*H264Layer, bool) { 11078 return nil, false 11079} 11080 11081// AsJpgLayer is the BasicLayer implementation for VideoLayer. 11082func (vl VideoLayer) AsJpgLayer() (*JpgLayer, bool) { 11083 return nil, false 11084} 11085 11086// AsPngLayer is the BasicLayer implementation for VideoLayer. 11087func (vl VideoLayer) AsPngLayer() (*PngLayer, bool) { 11088 return nil, false 11089} 11090 11091// AsLayer is the BasicLayer implementation for VideoLayer. 11092func (vl VideoLayer) AsLayer() (*Layer, bool) { 11093 return nil, false 11094} 11095 11096// AsBasicLayer is the BasicLayer implementation for VideoLayer. 11097func (vl VideoLayer) AsBasicLayer() (BasicLayer, bool) { 11098 return &vl, true 11099} 11100 11101// VideoOverlay describes the properties of a video overlay. 11102type VideoOverlay struct { 11103 // Position - The location in the input video where the overlay is applied. 11104 Position *Rectangle `json:"position,omitempty"` 11105 // Opacity - The opacity of the overlay. This is a value in the range [0 - 1.0]. Default is 1.0 which mean the overlay is opaque. 11106 Opacity *float64 `json:"opacity,omitempty"` 11107 // CropRectangle - An optional rectangular window used to crop the overlay image or video. 11108 CropRectangle *Rectangle `json:"cropRectangle,omitempty"` 11109 // InputLabel - The label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG or PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats. 11110 InputLabel *string `json:"inputLabel,omitempty"` 11111 // Start - The start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds in to the input video. If not specified the overlay starts from the beginning of the input video. 11112 Start *string `json:"start,omitempty"` 11113 // End - The position in the input video at which the overlay ends. The value should be in ISO 8601 duration format. For example, PT30S to end the overlay at 30 seconds in to the input video. If not specified the overlay will be applied until the end of the input video if inputLoop is true. Else, if inputLoop is false, then overlay will last as long as the duration of the overlay media. 11114 End *string `json:"end,omitempty"` 11115 // FadeInDuration - The duration over which the overlay fades in onto the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade in (same as PT0S). 11116 FadeInDuration *string `json:"fadeInDuration,omitempty"` 11117 // FadeOutDuration - The duration over which the overlay fades out of the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade out (same as PT0S). 11118 FadeOutDuration *string `json:"fadeOutDuration,omitempty"` 11119 // AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0. 11120 AudioGainLevel *float64 `json:"audioGainLevel,omitempty"` 11121 // OdataType - Possible values include: 'OdataTypeOverlay', 'OdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeMicrosoftMediaVideoOverlay' 11122 OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"` 11123} 11124 11125// MarshalJSON is the custom marshaler for VideoOverlay. 11126func (vo VideoOverlay) MarshalJSON() ([]byte, error) { 11127 vo.OdataType = OdataTypeMicrosoftMediaVideoOverlay 11128 objectMap := make(map[string]interface{}) 11129 if vo.Position != nil { 11130 objectMap["position"] = vo.Position 11131 } 11132 if vo.Opacity != nil { 11133 objectMap["opacity"] = vo.Opacity 11134 } 11135 if vo.CropRectangle != nil { 11136 objectMap["cropRectangle"] = vo.CropRectangle 11137 } 11138 if vo.InputLabel != nil { 11139 objectMap["inputLabel"] = vo.InputLabel 11140 } 11141 if vo.Start != nil { 11142 objectMap["start"] = vo.Start 11143 } 11144 if vo.End != nil { 11145 objectMap["end"] = vo.End 11146 } 11147 if vo.FadeInDuration != nil { 11148 objectMap["fadeInDuration"] = vo.FadeInDuration 11149 } 11150 if vo.FadeOutDuration != nil { 11151 objectMap["fadeOutDuration"] = vo.FadeOutDuration 11152 } 11153 if vo.AudioGainLevel != nil { 11154 objectMap["audioGainLevel"] = vo.AudioGainLevel 11155 } 11156 if vo.OdataType != "" { 11157 objectMap["@odata.type"] = vo.OdataType 11158 } 11159 return json.Marshal(objectMap) 11160} 11161 11162// AsAudioOverlay is the BasicOverlay implementation for VideoOverlay. 11163func (vo VideoOverlay) AsAudioOverlay() (*AudioOverlay, bool) { 11164 return nil, false 11165} 11166 11167// AsVideoOverlay is the BasicOverlay implementation for VideoOverlay. 11168func (vo VideoOverlay) AsVideoOverlay() (*VideoOverlay, bool) { 11169 return &vo, true 11170} 11171 11172// AsOverlay is the BasicOverlay implementation for VideoOverlay. 11173func (vo VideoOverlay) AsOverlay() (*Overlay, bool) { 11174 return nil, false 11175} 11176 11177// AsBasicOverlay is the BasicOverlay implementation for VideoOverlay. 11178func (vo VideoOverlay) AsBasicOverlay() (BasicOverlay, bool) { 11179 return &vo, true 11180} 11181