/
models.go
6335 lines (5729 loc) · 225 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package videoanalyzer
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/go-autorest/tracing"
"github.com/gofrs/uuid"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/videoanalyzer/mgmt/2021-11-01-preview/videoanalyzer"
// AccessPolicyEntity access policies help define the authentication rules, and control access to specific
// video resources.
type AccessPolicyEntity struct {
autorest.Response `json:"-"`
// AccessPolicyProperties - The resource properties.
*AccessPolicyProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `json:"type,omitempty"`
// SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
SystemData *SystemData `json:"systemData,omitempty"`
}
// MarshalJSON is the custom marshaler for AccessPolicyEntity.
func (ape AccessPolicyEntity) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ape.AccessPolicyProperties != nil {
objectMap["properties"] = ape.AccessPolicyProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for AccessPolicyEntity struct.
func (ape *AccessPolicyEntity) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var accessPolicyProperties AccessPolicyProperties
err = json.Unmarshal(*v, &accessPolicyProperties)
if err != nil {
return err
}
ape.AccessPolicyProperties = &accessPolicyProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
ape.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
ape.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
ape.Type = &typeVar
}
case "systemData":
if v != nil {
var systemData SystemData
err = json.Unmarshal(*v, &systemData)
if err != nil {
return err
}
ape.SystemData = &systemData
}
}
}
return nil
}
// AccessPolicyEntityCollection a collection of AccessPolicyEntity items.
type AccessPolicyEntityCollection struct {
autorest.Response `json:"-"`
// Value - A collection of AccessPolicyEntity items.
Value *[]AccessPolicyEntity `json:"value,omitempty"`
// NextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
NextLink *string `json:"@nextLink,omitempty"`
}
// AccessPolicyEntityCollectionIterator provides access to a complete listing of AccessPolicyEntity values.
type AccessPolicyEntityCollectionIterator struct {
i int
page AccessPolicyEntityCollectionPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *AccessPolicyEntityCollectionIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AccessPolicyEntityCollectionIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *AccessPolicyEntityCollectionIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter AccessPolicyEntityCollectionIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter AccessPolicyEntityCollectionIterator) Response() AccessPolicyEntityCollection {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter AccessPolicyEntityCollectionIterator) Value() AccessPolicyEntity {
if !iter.page.NotDone() {
return AccessPolicyEntity{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the AccessPolicyEntityCollectionIterator type.
func NewAccessPolicyEntityCollectionIterator(page AccessPolicyEntityCollectionPage) AccessPolicyEntityCollectionIterator {
return AccessPolicyEntityCollectionIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (apec AccessPolicyEntityCollection) IsEmpty() bool {
return apec.Value == nil || len(*apec.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (apec AccessPolicyEntityCollection) hasNextLink() bool {
return apec.NextLink != nil && len(*apec.NextLink) != 0
}
// accessPolicyEntityCollectionPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (apec AccessPolicyEntityCollection) accessPolicyEntityCollectionPreparer(ctx context.Context) (*http.Request, error) {
if !apec.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(apec.NextLink)))
}
// AccessPolicyEntityCollectionPage contains a page of AccessPolicyEntity values.
type AccessPolicyEntityCollectionPage struct {
fn func(context.Context, AccessPolicyEntityCollection) (AccessPolicyEntityCollection, error)
apec AccessPolicyEntityCollection
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *AccessPolicyEntityCollectionPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AccessPolicyEntityCollectionPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.apec)
if err != nil {
return err
}
page.apec = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *AccessPolicyEntityCollectionPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page AccessPolicyEntityCollectionPage) NotDone() bool {
return !page.apec.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page AccessPolicyEntityCollectionPage) Response() AccessPolicyEntityCollection {
return page.apec
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page AccessPolicyEntityCollectionPage) Values() []AccessPolicyEntity {
if page.apec.IsEmpty() {
return nil
}
return *page.apec.Value
}
// Creates a new instance of the AccessPolicyEntityCollectionPage type.
func NewAccessPolicyEntityCollectionPage(cur AccessPolicyEntityCollection, getNextPage func(context.Context, AccessPolicyEntityCollection) (AccessPolicyEntityCollection, error)) AccessPolicyEntityCollectionPage {
return AccessPolicyEntityCollectionPage{
fn: getNextPage,
apec: cur,
}
}
// AccessPolicyProperties application level properties for the access policy resource.
type AccessPolicyProperties struct {
// Role - Defines the access level granted by this policy. Possible values include: 'AccessPolicyRoleReader'
Role AccessPolicyRole `json:"role,omitempty"`
// Authentication - Authentication method to be used when validating client API access.
Authentication BasicAuthenticationBase `json:"authentication,omitempty"`
}
// UnmarshalJSON is the custom unmarshaler for AccessPolicyProperties struct.
func (app *AccessPolicyProperties) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "role":
if v != nil {
var role AccessPolicyRole
err = json.Unmarshal(*v, &role)
if err != nil {
return err
}
app.Role = role
}
case "authentication":
if v != nil {
authentication, err := unmarshalBasicAuthenticationBase(*v)
if err != nil {
return err
}
app.Authentication = authentication
}
}
}
return nil
}
// AccountEncryption defines how the Video Analyzer account is (optionally) encrypted.
type AccountEncryption struct {
// Type - The type of key used to encrypt the Account Key. Possible values include: 'AccountEncryptionKeyTypeSystemKey', 'AccountEncryptionKeyTypeCustomerKey'
Type AccountEncryptionKeyType `json:"type,omitempty"`
// KeyVaultProperties - The properties of the key used to encrypt the account.
KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"`
// Identity - The Key Vault identity.
Identity *ResourceIdentity `json:"identity,omitempty"`
// Status - READ-ONLY; The current status of the Key Vault mapping.
Status *string `json:"status,omitempty"`
}
// MarshalJSON is the custom marshaler for AccountEncryption.
func (ae AccountEncryption) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ae.Type != "" {
objectMap["type"] = ae.Type
}
if ae.KeyVaultProperties != nil {
objectMap["keyVaultProperties"] = ae.KeyVaultProperties
}
if ae.Identity != nil {
objectMap["identity"] = ae.Identity
}
return json.Marshal(objectMap)
}
// AudioEncoderAac a custom preset for encoding audio with the AAC codec.
type AudioEncoderAac struct {
// BitrateKbps - Bitrate, in kilobits per second or Kbps, at which audio should be encoded (2-channel stereo audio at a sampling rate of 48 kHz). Allowed values are 96, 112, 128, 160, 192, 224, and 256. If omitted, the bitrate of the input audio is used.
BitrateKbps *string `json:"bitrateKbps,omitempty"`
// Type - Possible values include: 'TypeBasicAudioEncoderBaseTypeAudioEncoderBase', 'TypeBasicAudioEncoderBaseTypeMicrosoftVideoAnalyzerAudioEncoderAac'
Type TypeBasicAudioEncoderBase `json:"@type,omitempty"`
}
// MarshalJSON is the custom marshaler for AudioEncoderAac.
func (aea AudioEncoderAac) MarshalJSON() ([]byte, error) {
aea.Type = TypeBasicAudioEncoderBaseTypeMicrosoftVideoAnalyzerAudioEncoderAac
objectMap := make(map[string]interface{})
if aea.BitrateKbps != nil {
objectMap["bitrateKbps"] = aea.BitrateKbps
}
if aea.Type != "" {
objectMap["@type"] = aea.Type
}
return json.Marshal(objectMap)
}
// AsAudioEncoderAac is the BasicAudioEncoderBase implementation for AudioEncoderAac.
func (aea AudioEncoderAac) AsAudioEncoderAac() (*AudioEncoderAac, bool) {
return &aea, true
}
// AsAudioEncoderBase is the BasicAudioEncoderBase implementation for AudioEncoderAac.
func (aea AudioEncoderAac) AsAudioEncoderBase() (*AudioEncoderBase, bool) {
return nil, false
}
// AsBasicAudioEncoderBase is the BasicAudioEncoderBase implementation for AudioEncoderAac.
func (aea AudioEncoderAac) AsBasicAudioEncoderBase() (BasicAudioEncoderBase, bool) {
return &aea, true
}
// BasicAudioEncoderBase base type for all audio encoder presets, which define the recipe or instructions on how audio
// should be processed.
type BasicAudioEncoderBase interface {
AsAudioEncoderAac() (*AudioEncoderAac, bool)
AsAudioEncoderBase() (*AudioEncoderBase, bool)
}
// AudioEncoderBase base type for all audio encoder presets, which define the recipe or instructions on how
// audio should be processed.
type AudioEncoderBase struct {
// BitrateKbps - Bitrate, in kilobits per second or Kbps, at which audio should be encoded (2-channel stereo audio at a sampling rate of 48 kHz). Allowed values are 96, 112, 128, 160, 192, 224, and 256. If omitted, the bitrate of the input audio is used.
BitrateKbps *string `json:"bitrateKbps,omitempty"`
// Type - Possible values include: 'TypeBasicAudioEncoderBaseTypeAudioEncoderBase', 'TypeBasicAudioEncoderBaseTypeMicrosoftVideoAnalyzerAudioEncoderAac'
Type TypeBasicAudioEncoderBase `json:"@type,omitempty"`
}
func unmarshalBasicAudioEncoderBase(body []byte) (BasicAudioEncoderBase, error) {
var m map[string]interface{}
err := json.Unmarshal(body, &m)
if err != nil {
return nil, err
}
switch m["@type"] {
case string(TypeBasicAudioEncoderBaseTypeMicrosoftVideoAnalyzerAudioEncoderAac):
var aea AudioEncoderAac
err := json.Unmarshal(body, &aea)
return aea, err
default:
var aeb AudioEncoderBase
err := json.Unmarshal(body, &aeb)
return aeb, err
}
}
func unmarshalBasicAudioEncoderBaseArray(body []byte) ([]BasicAudioEncoderBase, error) {
var rawMessages []*json.RawMessage
err := json.Unmarshal(body, &rawMessages)
if err != nil {
return nil, err
}
aebArray := make([]BasicAudioEncoderBase, len(rawMessages))
for index, rawMessage := range rawMessages {
aeb, err := unmarshalBasicAudioEncoderBase(*rawMessage)
if err != nil {
return nil, err
}
aebArray[index] = aeb
}
return aebArray, nil
}
// MarshalJSON is the custom marshaler for AudioEncoderBase.
func (aeb AudioEncoderBase) MarshalJSON() ([]byte, error) {
aeb.Type = TypeBasicAudioEncoderBaseTypeAudioEncoderBase
objectMap := make(map[string]interface{})
if aeb.BitrateKbps != nil {
objectMap["bitrateKbps"] = aeb.BitrateKbps
}
if aeb.Type != "" {
objectMap["@type"] = aeb.Type
}
return json.Marshal(objectMap)
}
// AsAudioEncoderAac is the BasicAudioEncoderBase implementation for AudioEncoderBase.
func (aeb AudioEncoderBase) AsAudioEncoderAac() (*AudioEncoderAac, bool) {
return nil, false
}
// AsAudioEncoderBase is the BasicAudioEncoderBase implementation for AudioEncoderBase.
func (aeb AudioEncoderBase) AsAudioEncoderBase() (*AudioEncoderBase, bool) {
return &aeb, true
}
// AsBasicAudioEncoderBase is the BasicAudioEncoderBase implementation for AudioEncoderBase.
func (aeb AudioEncoderBase) AsBasicAudioEncoderBase() (BasicAudioEncoderBase, bool) {
return &aeb, true
}
// BasicAuthenticationBase base class for access policies authentication methods.
type BasicAuthenticationBase interface {
AsJwtAuthentication() (*JwtAuthentication, bool)
AsAuthenticationBase() (*AuthenticationBase, bool)
}
// AuthenticationBase base class for access policies authentication methods.
type AuthenticationBase struct {
// Type - Possible values include: 'TypeBasicAuthenticationBaseTypeAuthenticationBase', 'TypeBasicAuthenticationBaseTypeMicrosoftVideoAnalyzerJwtAuthentication'
Type TypeBasicAuthenticationBase `json:"@type,omitempty"`
}
func unmarshalBasicAuthenticationBase(body []byte) (BasicAuthenticationBase, error) {
var m map[string]interface{}
err := json.Unmarshal(body, &m)
if err != nil {
return nil, err
}
switch m["@type"] {
case string(TypeBasicAuthenticationBaseTypeMicrosoftVideoAnalyzerJwtAuthentication):
var ja JwtAuthentication
err := json.Unmarshal(body, &ja)
return ja, err
default:
var ab AuthenticationBase
err := json.Unmarshal(body, &ab)
return ab, err
}
}
func unmarshalBasicAuthenticationBaseArray(body []byte) ([]BasicAuthenticationBase, error) {
var rawMessages []*json.RawMessage
err := json.Unmarshal(body, &rawMessages)
if err != nil {
return nil, err
}
abArray := make([]BasicAuthenticationBase, len(rawMessages))
for index, rawMessage := range rawMessages {
ab, err := unmarshalBasicAuthenticationBase(*rawMessage)
if err != nil {
return nil, err
}
abArray[index] = ab
}
return abArray, nil
}
// MarshalJSON is the custom marshaler for AuthenticationBase.
func (ab AuthenticationBase) MarshalJSON() ([]byte, error) {
ab.Type = TypeBasicAuthenticationBaseTypeAuthenticationBase
objectMap := make(map[string]interface{})
if ab.Type != "" {
objectMap["@type"] = ab.Type
}
return json.Marshal(objectMap)
}
// AsJwtAuthentication is the BasicAuthenticationBase implementation for AuthenticationBase.
func (ab AuthenticationBase) AsJwtAuthentication() (*JwtAuthentication, bool) {
return nil, false
}
// AsAuthenticationBase is the BasicAuthenticationBase implementation for AuthenticationBase.
func (ab AuthenticationBase) AsAuthenticationBase() (*AuthenticationBase, bool) {
return &ab, true
}
// AsBasicAuthenticationBase is the BasicAuthenticationBase implementation for AuthenticationBase.
func (ab AuthenticationBase) AsBasicAuthenticationBase() (BasicAuthenticationBase, bool) {
return &ab, true
}
// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag.
type AzureEntityResource struct {
// Etag - READ-ONLY; Resource Etag.
Etag *string `json:"etag,omitempty"`
// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `json:"type,omitempty"`
// SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
SystemData *SystemData `json:"systemData,omitempty"`
}
// MarshalJSON is the custom marshaler for AzureEntityResource.
func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// BasicCertificateSource base class for certificate sources.
type BasicCertificateSource interface {
AsPemCertificateList() (*PemCertificateList, bool)
AsCertificateSource() (*CertificateSource, bool)
}
// CertificateSource base class for certificate sources.
type CertificateSource struct {
// Type - Possible values include: 'TypeBasicCertificateSourceTypeCertificateSource', 'TypeBasicCertificateSourceTypeMicrosoftVideoAnalyzerPemCertificateList'
Type TypeBasicCertificateSource `json:"@type,omitempty"`
}
func unmarshalBasicCertificateSource(body []byte) (BasicCertificateSource, error) {
var m map[string]interface{}
err := json.Unmarshal(body, &m)
if err != nil {
return nil, err
}
switch m["@type"] {
case string(TypeBasicCertificateSourceTypeMicrosoftVideoAnalyzerPemCertificateList):
var pcl PemCertificateList
err := json.Unmarshal(body, &pcl)
return pcl, err
default:
var cs CertificateSource
err := json.Unmarshal(body, &cs)
return cs, err
}
}
func unmarshalBasicCertificateSourceArray(body []byte) ([]BasicCertificateSource, error) {
var rawMessages []*json.RawMessage
err := json.Unmarshal(body, &rawMessages)
if err != nil {
return nil, err
}
csArray := make([]BasicCertificateSource, len(rawMessages))
for index, rawMessage := range rawMessages {
cs, err := unmarshalBasicCertificateSource(*rawMessage)
if err != nil {
return nil, err
}
csArray[index] = cs
}
return csArray, nil
}
// MarshalJSON is the custom marshaler for CertificateSource.
func (cs CertificateSource) MarshalJSON() ([]byte, error) {
cs.Type = TypeBasicCertificateSourceTypeCertificateSource
objectMap := make(map[string]interface{})
if cs.Type != "" {
objectMap["@type"] = cs.Type
}
return json.Marshal(objectMap)
}
// AsPemCertificateList is the BasicCertificateSource implementation for CertificateSource.
func (cs CertificateSource) AsPemCertificateList() (*PemCertificateList, bool) {
return nil, false
}
// AsCertificateSource is the BasicCertificateSource implementation for CertificateSource.
func (cs CertificateSource) AsCertificateSource() (*CertificateSource, bool) {
return &cs, true
}
// AsBasicCertificateSource is the BasicCertificateSource implementation for CertificateSource.
func (cs CertificateSource) AsBasicCertificateSource() (BasicCertificateSource, bool) {
return &cs, true
}
// CheckNameAvailabilityRequest the check availability request body.
type CheckNameAvailabilityRequest struct {
// Name - The name of the resource for which availability needs to be checked.
Name *string `json:"name,omitempty"`
// Type - The resource type.
Type *string `json:"type,omitempty"`
}
// CheckNameAvailabilityResponse the check availability result.
type CheckNameAvailabilityResponse struct {
autorest.Response `json:"-"`
// NameAvailable - Indicates if the resource name is available.
NameAvailable *bool `json:"nameAvailable,omitempty"`
// Reason - The reason why the given name is not available. Possible values include: 'CheckNameAvailabilityReasonInvalid', 'CheckNameAvailabilityReasonAlreadyExists'
Reason CheckNameAvailabilityReason `json:"reason,omitempty"`
// Message - Detailed reason why the given name is available.
Message *string `json:"message,omitempty"`
}
// Collection a collection of VideoAnalyzer items.
type Collection struct {
autorest.Response `json:"-"`
// Value - A collection of VideoAnalyzer items.
Value *[]Model `json:"value,omitempty"`
}
// BasicCredentialsBase base class for credential objects.
type BasicCredentialsBase interface {
AsUsernamePasswordCredentials() (*UsernamePasswordCredentials, bool)
AsCredentialsBase() (*CredentialsBase, bool)
}
// CredentialsBase base class for credential objects.
type CredentialsBase struct {
// Type - Possible values include: 'TypeBasicCredentialsBaseTypeCredentialsBase', 'TypeBasicCredentialsBaseTypeMicrosoftVideoAnalyzerUsernamePasswordCredentials'
Type TypeBasicCredentialsBase `json:"@type,omitempty"`
}
func unmarshalBasicCredentialsBase(body []byte) (BasicCredentialsBase, error) {
var m map[string]interface{}
err := json.Unmarshal(body, &m)
if err != nil {
return nil, err
}
switch m["@type"] {
case string(TypeBasicCredentialsBaseTypeMicrosoftVideoAnalyzerUsernamePasswordCredentials):
var upc UsernamePasswordCredentials
err := json.Unmarshal(body, &upc)
return upc, err
default:
var cb CredentialsBase
err := json.Unmarshal(body, &cb)
return cb, err
}
}
func unmarshalBasicCredentialsBaseArray(body []byte) ([]BasicCredentialsBase, error) {
var rawMessages []*json.RawMessage
err := json.Unmarshal(body, &rawMessages)
if err != nil {
return nil, err
}
cbArray := make([]BasicCredentialsBase, len(rawMessages))
for index, rawMessage := range rawMessages {
cb, err := unmarshalBasicCredentialsBase(*rawMessage)
if err != nil {
return nil, err
}
cbArray[index] = cb
}
return cbArray, nil
}
// MarshalJSON is the custom marshaler for CredentialsBase.
func (cb CredentialsBase) MarshalJSON() ([]byte, error) {
cb.Type = TypeBasicCredentialsBaseTypeCredentialsBase
objectMap := make(map[string]interface{})
if cb.Type != "" {
objectMap["@type"] = cb.Type
}
return json.Marshal(objectMap)
}
// AsUsernamePasswordCredentials is the BasicCredentialsBase implementation for CredentialsBase.
func (cb CredentialsBase) AsUsernamePasswordCredentials() (*UsernamePasswordCredentials, bool) {
return nil, false
}
// AsCredentialsBase is the BasicCredentialsBase implementation for CredentialsBase.
func (cb CredentialsBase) AsCredentialsBase() (*CredentialsBase, bool) {
return &cb, true
}
// AsBasicCredentialsBase is the BasicCredentialsBase implementation for CredentialsBase.
func (cb CredentialsBase) AsBasicCredentialsBase() (BasicCredentialsBase, bool) {
return &cb, true
}
// EccTokenKey required validation properties for tokens generated with Elliptical Curve algorithm.
type EccTokenKey struct {
// Alg - Elliptical curve algorithm to be used: ES256, ES384 or ES512. Possible values include: 'AccessPolicyEccAlgoES256', 'AccessPolicyEccAlgoES384', 'AccessPolicyEccAlgoES512'
Alg AccessPolicyEccAlgo `json:"alg,omitempty"`
// X - X coordinate.
X *string `json:"x,omitempty"`
// Y - Y coordinate.
Y *string `json:"y,omitempty"`
// Kid - JWT token key id. Validation keys are looked up based on the key id present on the JWT token header.
Kid *string `json:"kid,omitempty"`
// Type - Possible values include: 'TypeBasicTokenKeyTypeTokenKey', 'TypeBasicTokenKeyTypeMicrosoftVideoAnalyzerRsaTokenKey', 'TypeBasicTokenKeyTypeMicrosoftVideoAnalyzerEccTokenKey'
Type TypeBasicTokenKey `json:"@type,omitempty"`
}
// MarshalJSON is the custom marshaler for EccTokenKey.
func (etk EccTokenKey) MarshalJSON() ([]byte, error) {
etk.Type = TypeBasicTokenKeyTypeMicrosoftVideoAnalyzerEccTokenKey
objectMap := make(map[string]interface{})
if etk.Alg != "" {
objectMap["alg"] = etk.Alg
}
if etk.X != nil {
objectMap["x"] = etk.X
}
if etk.Y != nil {
objectMap["y"] = etk.Y
}
if etk.Kid != nil {
objectMap["kid"] = etk.Kid
}
if etk.Type != "" {
objectMap["@type"] = etk.Type
}
return json.Marshal(objectMap)
}
// AsRsaTokenKey is the BasicTokenKey implementation for EccTokenKey.
func (etk EccTokenKey) AsRsaTokenKey() (*RsaTokenKey, bool) {
return nil, false
}
// AsEccTokenKey is the BasicTokenKey implementation for EccTokenKey.
func (etk EccTokenKey) AsEccTokenKey() (*EccTokenKey, bool) {
return &etk, true
}
// AsTokenKey is the BasicTokenKey implementation for EccTokenKey.
func (etk EccTokenKey) AsTokenKey() (*TokenKey, bool) {
return nil, false
}
// AsBasicTokenKey is the BasicTokenKey implementation for EccTokenKey.
func (etk EccTokenKey) AsBasicTokenKey() (BasicTokenKey, bool) {
return &etk, true
}
// EdgeModuleEntity the representation of an edge module.
type EdgeModuleEntity struct {
autorest.Response `json:"-"`
// EdgeModuleProperties - The resource properties.
*EdgeModuleProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `json:"type,omitempty"`
// SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
SystemData *SystemData `json:"systemData,omitempty"`
}
// MarshalJSON is the custom marshaler for EdgeModuleEntity.
func (eme EdgeModuleEntity) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if eme.EdgeModuleProperties != nil {
objectMap["properties"] = eme.EdgeModuleProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for EdgeModuleEntity struct.
func (eme *EdgeModuleEntity) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var edgeModuleProperties EdgeModuleProperties
err = json.Unmarshal(*v, &edgeModuleProperties)
if err != nil {
return err
}
eme.EdgeModuleProperties = &edgeModuleProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
eme.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
eme.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
eme.Type = &typeVar
}
case "systemData":
if v != nil {
var systemData SystemData
err = json.Unmarshal(*v, &systemData)
if err != nil {
return err
}
eme.SystemData = &systemData
}
}
}
return nil
}
// EdgeModuleEntityCollection a collection of EdgeModuleEntity items.
type EdgeModuleEntityCollection struct {
autorest.Response `json:"-"`
// Value - A collection of EdgeModuleEntity items.
Value *[]EdgeModuleEntity `json:"value,omitempty"`
// NextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
NextLink *string `json:"@nextLink,omitempty"`
}
// EdgeModuleEntityCollectionIterator provides access to a complete listing of EdgeModuleEntity values.
type EdgeModuleEntityCollectionIterator struct {
i int
page EdgeModuleEntityCollectionPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *EdgeModuleEntityCollectionIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/EdgeModuleEntityCollectionIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *EdgeModuleEntityCollectionIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter EdgeModuleEntityCollectionIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter EdgeModuleEntityCollectionIterator) Response() EdgeModuleEntityCollection {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter EdgeModuleEntityCollectionIterator) Value() EdgeModuleEntity {
if !iter.page.NotDone() {
return EdgeModuleEntity{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the EdgeModuleEntityCollectionIterator type.
func NewEdgeModuleEntityCollectionIterator(page EdgeModuleEntityCollectionPage) EdgeModuleEntityCollectionIterator {
return EdgeModuleEntityCollectionIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (emec EdgeModuleEntityCollection) IsEmpty() bool {
return emec.Value == nil || len(*emec.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (emec EdgeModuleEntityCollection) hasNextLink() bool {
return emec.NextLink != nil && len(*emec.NextLink) != 0
}
// edgeModuleEntityCollectionPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (emec EdgeModuleEntityCollection) edgeModuleEntityCollectionPreparer(ctx context.Context) (*http.Request, error) {
if !emec.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(emec.NextLink)))
}
// EdgeModuleEntityCollectionPage contains a page of EdgeModuleEntity values.
type EdgeModuleEntityCollectionPage struct {
fn func(context.Context, EdgeModuleEntityCollection) (EdgeModuleEntityCollection, error)
emec EdgeModuleEntityCollection
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *EdgeModuleEntityCollectionPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/EdgeModuleEntityCollectionPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.emec)
if err != nil {
return err
}
page.emec = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *EdgeModuleEntityCollectionPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page EdgeModuleEntityCollectionPage) NotDone() bool {
return !page.emec.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page EdgeModuleEntityCollectionPage) Response() EdgeModuleEntityCollection {
return page.emec