/
models.go
3507 lines (3204 loc) · 126 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 healthcareapis
// 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"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/healthcareapis/mgmt/2021-06-01-preview/healthcareapis"
// 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"`
}
// MarshalJSON is the custom marshaler for AzureEntityResource.
func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// CheckNameAvailabilityParameters input values.
type CheckNameAvailabilityParameters struct {
// Name - The name of the service instance to check.
Name *string `json:"name,omitempty"`
// Type - The fully qualified resource type which includes provider namespace.
Type *string `json:"type,omitempty"`
}
// DicomService the description of Dicom Service
type DicomService struct {
autorest.Response `json:"-"`
// DicomServiceProperties - Dicom Service configuration.
*DicomServiceProperties `json:"properties,omitempty"`
// SystemData - Metadata pertaining to creation and last modification of the resource.
SystemData *SystemData `json:"systemData,omitempty"`
// Tags - Resource tags.
Tags map[string]*string `json:"tags"`
// Location - The resource location.
Location *string `json:"location,omitempty"`
}
// MarshalJSON is the custom marshaler for DicomService.
func (ds DicomService) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ds.DicomServiceProperties != nil {
objectMap["properties"] = ds.DicomServiceProperties
}
if ds.SystemData != nil {
objectMap["systemData"] = ds.SystemData
}
if ds.Tags != nil {
objectMap["tags"] = ds.Tags
}
if ds.Location != nil {
objectMap["location"] = ds.Location
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for DicomService struct.
func (ds *DicomService) 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 dicomServiceProperties DicomServiceProperties
err = json.Unmarshal(*v, &dicomServiceProperties)
if err != nil {
return err
}
ds.DicomServiceProperties = &dicomServiceProperties
}
case "systemData":
if v != nil {
var systemData SystemData
err = json.Unmarshal(*v, &systemData)
if err != nil {
return err
}
ds.SystemData = &systemData
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
ds.Tags = tags
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
ds.Location = &location
}
}
}
return nil
}
// DicomServiceAuthenticationConfiguration authentication configuration information
type DicomServiceAuthenticationConfiguration struct {
// Authority - READ-ONLY; The authority url for the service
Authority *string `json:"authority,omitempty"`
// Audiences - READ-ONLY; The audiences for the service
Audiences *[]string `json:"audiences,omitempty"`
}
// MarshalJSON is the custom marshaler for DicomServiceAuthenticationConfiguration.
func (dsac DicomServiceAuthenticationConfiguration) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// DicomServiceCollection the collection of Dicom Services.
type DicomServiceCollection struct {
autorest.Response `json:"-"`
// NextLink - The link used to get the next page of Dicom Services.
NextLink *string `json:"nextLink,omitempty"`
// Value - The list of Dicom Services.
Value *[]DicomService `json:"value,omitempty"`
}
// DicomServiceCollectionIterator provides access to a complete listing of DicomService values.
type DicomServiceCollectionIterator struct {
i int
page DicomServiceCollectionPage
}
// 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 *DicomServiceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/DicomServiceCollectionIterator.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 *DicomServiceCollectionIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter DicomServiceCollectionIterator) 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 DicomServiceCollectionIterator) Response() DicomServiceCollection {
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 DicomServiceCollectionIterator) Value() DicomService {
if !iter.page.NotDone() {
return DicomService{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the DicomServiceCollectionIterator type.
func NewDicomServiceCollectionIterator(page DicomServiceCollectionPage) DicomServiceCollectionIterator {
return DicomServiceCollectionIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (dsc DicomServiceCollection) IsEmpty() bool {
return dsc.Value == nil || len(*dsc.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (dsc DicomServiceCollection) hasNextLink() bool {
return dsc.NextLink != nil && len(*dsc.NextLink) != 0
}
// dicomServiceCollectionPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (dsc DicomServiceCollection) dicomServiceCollectionPreparer(ctx context.Context) (*http.Request, error) {
if !dsc.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(dsc.NextLink)))
}
// DicomServiceCollectionPage contains a page of DicomService values.
type DicomServiceCollectionPage struct {
fn func(context.Context, DicomServiceCollection) (DicomServiceCollection, error)
dsc DicomServiceCollection
}
// 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 *DicomServiceCollectionPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/DicomServiceCollectionPage.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.dsc)
if err != nil {
return err
}
page.dsc = 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 *DicomServiceCollectionPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page DicomServiceCollectionPage) NotDone() bool {
return !page.dsc.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page DicomServiceCollectionPage) Response() DicomServiceCollection {
return page.dsc
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page DicomServiceCollectionPage) Values() []DicomService {
if page.dsc.IsEmpty() {
return nil
}
return *page.dsc.Value
}
// Creates a new instance of the DicomServiceCollectionPage type.
func NewDicomServiceCollectionPage(cur DicomServiceCollection, getNextPage func(context.Context, DicomServiceCollection) (DicomServiceCollection, error)) DicomServiceCollectionPage {
return DicomServiceCollectionPage{
fn: getNextPage,
dsc: cur,
}
}
// DicomServicePatchResource dicom Service patch properties
type DicomServicePatchResource struct {
// Tags - Resource tags.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for DicomServicePatchResource.
func (dspr DicomServicePatchResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if dspr.Tags != nil {
objectMap["tags"] = dspr.Tags
}
return json.Marshal(objectMap)
}
// DicomServiceProperties dicom Service properties.
type DicomServiceProperties struct {
// ProvisioningState - The provisioning state. Possible values include: 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateCreating', 'ProvisioningStateAccepted', 'ProvisioningStateVerifying', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeprovisioned', 'ProvisioningStateMoving', 'ProvisioningStateSuspended', 'ProvisioningStateWarned', 'ProvisioningStateSystemMaintenance'
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
// AuthenticationConfiguration - Dicom Service authentication configuration.
AuthenticationConfiguration *DicomServiceAuthenticationConfiguration `json:"authenticationConfiguration,omitempty"`
// ServiceURL - READ-ONLY; The url of the Dicom Services.
ServiceURL *string `json:"serviceUrl,omitempty"`
}
// MarshalJSON is the custom marshaler for DicomServiceProperties.
func (dsp DicomServiceProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if dsp.ProvisioningState != "" {
objectMap["provisioningState"] = dsp.ProvisioningState
}
if dsp.AuthenticationConfiguration != nil {
objectMap["authenticationConfiguration"] = dsp.AuthenticationConfiguration
}
return json.Marshal(objectMap)
}
// DicomServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type DicomServicesCreateOrUpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(DicomServicesClient) (DicomService, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *DicomServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for DicomServicesCreateOrUpdateFuture.Result.
func (future *DicomServicesCreateOrUpdateFuture) result(client DicomServicesClient) (ds DicomService, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ds.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("healthcareapis.DicomServicesCreateOrUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if ds.Response.Response, err = future.GetResult(sender); err == nil && ds.Response.Response.StatusCode != http.StatusNoContent {
ds, err = client.CreateOrUpdateResponder(ds.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesCreateOrUpdateFuture", "Result", ds.Response.Response, "Failure responding to request")
}
}
return
}
// DicomServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type DicomServicesDeleteFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(DicomServicesClient) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *DicomServicesDeleteFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for DicomServicesDeleteFuture.Result.
func (future *DicomServicesDeleteFuture) result(client DicomServicesClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("healthcareapis.DicomServicesDeleteFuture")
return
}
ar.Response = future.Response()
return
}
// DicomServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type DicomServicesUpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(DicomServicesClient) (DicomService, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *DicomServicesUpdateFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for DicomServicesUpdateFuture.Result.
func (future *DicomServicesUpdateFuture) result(client DicomServicesClient) (ds DicomService, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ds.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("healthcareapis.DicomServicesUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if ds.Response.Response, err = future.GetResult(sender); err == nil && ds.Response.Response.StatusCode != http.StatusNoContent {
ds, err = client.UpdateResponder(ds.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesUpdateFuture", "Result", ds.Response.Response, "Failure responding to request")
}
}
return
}
// Error error details.
type Error struct {
// Error - Error details
Error *ErrorDetailsInternal `json:"error,omitempty"`
}
// ErrorDetails error details.
type ErrorDetails struct {
// Error - Error details
Error *ErrorDetailsInternal `json:"error,omitempty"`
}
// ErrorDetailsInternal error details.
type ErrorDetailsInternal struct {
// Code - READ-ONLY; The error code.
Code *string `json:"code,omitempty"`
// Message - READ-ONLY; The error message.
Message *string `json:"message,omitempty"`
// Target - READ-ONLY; The target of the particular error.
Target *string `json:"target,omitempty"`
}
// MarshalJSON is the custom marshaler for ErrorDetailsInternal.
func (edi ErrorDetailsInternal) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// FhirService the description of Fhir Service
type FhirService struct {
autorest.Response `json:"-"`
// Tags - Resource tags.
Tags map[string]*string `json:"tags"`
// Location - The resource location.
Location *string `json:"location,omitempty"`
// Identity - Setting indicating whether the service has a managed identity associated with it.
Identity *ServiceManagedIdentityIdentity `json:"identity,omitempty"`
// Kind - The kind of the service. Possible values include: 'FhirServiceKindFhirStu3', 'FhirServiceKindFhirR4'
Kind FhirServiceKind `json:"kind,omitempty"`
// FhirServiceProperties - Fhir Service configuration.
*FhirServiceProperties `json:"properties,omitempty"`
// SystemData - Metadata pertaining to creation and last modification of the resource.
SystemData *SystemData `json:"systemData,omitempty"`
}
// MarshalJSON is the custom marshaler for FhirService.
func (fs FhirService) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if fs.Tags != nil {
objectMap["tags"] = fs.Tags
}
if fs.Location != nil {
objectMap["location"] = fs.Location
}
if fs.Identity != nil {
objectMap["identity"] = fs.Identity
}
if fs.Kind != "" {
objectMap["kind"] = fs.Kind
}
if fs.FhirServiceProperties != nil {
objectMap["properties"] = fs.FhirServiceProperties
}
if fs.SystemData != nil {
objectMap["systemData"] = fs.SystemData
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for FhirService struct.
func (fs *FhirService) 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 "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
fs.Tags = tags
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
fs.Location = &location
}
case "identity":
if v != nil {
var identity ServiceManagedIdentityIdentity
err = json.Unmarshal(*v, &identity)
if err != nil {
return err
}
fs.Identity = &identity
}
case "kind":
if v != nil {
var kind FhirServiceKind
err = json.Unmarshal(*v, &kind)
if err != nil {
return err
}
fs.Kind = kind
}
case "properties":
if v != nil {
var fhirServiceProperties FhirServiceProperties
err = json.Unmarshal(*v, &fhirServiceProperties)
if err != nil {
return err
}
fs.FhirServiceProperties = &fhirServiceProperties
}
case "systemData":
if v != nil {
var systemData SystemData
err = json.Unmarshal(*v, &systemData)
if err != nil {
return err
}
fs.SystemData = &systemData
}
}
}
return nil
}
// FhirServiceAccessPolicyEntry an access policy entry.
type FhirServiceAccessPolicyEntry struct {
// ObjectID - An Azure AD object ID (User or Apps) that is allowed access to the FHIR service.
ObjectID *string `json:"objectId,omitempty"`
}
// FhirServiceAcrConfiguration azure container registry configuration information
type FhirServiceAcrConfiguration struct {
// LoginServers - The list of the Azure container registry login servers.
LoginServers *[]string `json:"loginServers,omitempty"`
}
// FhirServiceAuthenticationConfiguration authentication configuration information
type FhirServiceAuthenticationConfiguration struct {
// Authority - The authority url for the service
Authority *string `json:"authority,omitempty"`
// Audience - The audience url for the service
Audience *string `json:"audience,omitempty"`
// SmartProxyEnabled - If the SMART on FHIR proxy is enabled
SmartProxyEnabled *bool `json:"smartProxyEnabled,omitempty"`
}
// FhirServiceCollection a collection of Fhir services.
type FhirServiceCollection struct {
autorest.Response `json:"-"`
// NextLink - The link used to get the next page of Fhir Services.
NextLink *string `json:"nextLink,omitempty"`
// Value - The list of Fhir Services.
Value *[]FhirService `json:"value,omitempty"`
}
// FhirServiceCollectionIterator provides access to a complete listing of FhirService values.
type FhirServiceCollectionIterator struct {
i int
page FhirServiceCollectionPage
}
// 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 *FhirServiceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/FhirServiceCollectionIterator.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 *FhirServiceCollectionIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter FhirServiceCollectionIterator) 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 FhirServiceCollectionIterator) Response() FhirServiceCollection {
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 FhirServiceCollectionIterator) Value() FhirService {
if !iter.page.NotDone() {
return FhirService{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the FhirServiceCollectionIterator type.
func NewFhirServiceCollectionIterator(page FhirServiceCollectionPage) FhirServiceCollectionIterator {
return FhirServiceCollectionIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (fsc FhirServiceCollection) IsEmpty() bool {
return fsc.Value == nil || len(*fsc.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (fsc FhirServiceCollection) hasNextLink() bool {
return fsc.NextLink != nil && len(*fsc.NextLink) != 0
}
// fhirServiceCollectionPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (fsc FhirServiceCollection) fhirServiceCollectionPreparer(ctx context.Context) (*http.Request, error) {
if !fsc.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(fsc.NextLink)))
}
// FhirServiceCollectionPage contains a page of FhirService values.
type FhirServiceCollectionPage struct {
fn func(context.Context, FhirServiceCollection) (FhirServiceCollection, error)
fsc FhirServiceCollection
}
// 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 *FhirServiceCollectionPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/FhirServiceCollectionPage.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.fsc)
if err != nil {
return err
}
page.fsc = 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 *FhirServiceCollectionPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page FhirServiceCollectionPage) NotDone() bool {
return !page.fsc.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page FhirServiceCollectionPage) Response() FhirServiceCollection {
return page.fsc
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page FhirServiceCollectionPage) Values() []FhirService {
if page.fsc.IsEmpty() {
return nil
}
return *page.fsc.Value
}
// Creates a new instance of the FhirServiceCollectionPage type.
func NewFhirServiceCollectionPage(cur FhirServiceCollection, getNextPage func(context.Context, FhirServiceCollection) (FhirServiceCollection, error)) FhirServiceCollectionPage {
return FhirServiceCollectionPage{
fn: getNextPage,
fsc: cur,
}
}
// FhirServiceCorsConfiguration the settings for the CORS configuration of the service instance.
type FhirServiceCorsConfiguration struct {
// Origins - The origins to be allowed via CORS.
Origins *[]string `json:"origins,omitempty"`
// Headers - The headers to be allowed via CORS.
Headers *[]string `json:"headers,omitempty"`
// Methods - The methods to be allowed via CORS.
Methods *[]string `json:"methods,omitempty"`
// MaxAge - The max age to be allowed via CORS.
MaxAge *int32 `json:"maxAge,omitempty"`
// AllowCredentials - If credentials are allowed via CORS.
AllowCredentials *bool `json:"allowCredentials,omitempty"`
}
// FhirServiceExportConfiguration export operation configuration information
type FhirServiceExportConfiguration struct {
// StorageAccountName - The name of the default export storage account.
StorageAccountName *string `json:"storageAccountName,omitempty"`
}
// FhirServicePatchResource fhirService patch properties
type FhirServicePatchResource struct {
// Tags - Resource tags.
Tags map[string]*string `json:"tags"`
// Identity - Setting indicating whether the service has a managed identity associated with it.
Identity *ServiceManagedIdentityIdentity `json:"identity,omitempty"`
}
// MarshalJSON is the custom marshaler for FhirServicePatchResource.
func (fspr FhirServicePatchResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if fspr.Tags != nil {
objectMap["tags"] = fspr.Tags
}
if fspr.Identity != nil {
objectMap["identity"] = fspr.Identity
}
return json.Marshal(objectMap)
}
// FhirServiceProperties fhir Service properties.
type FhirServiceProperties struct {
// ProvisioningState - The provisioning state. Possible values include: 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateCreating', 'ProvisioningStateAccepted', 'ProvisioningStateVerifying', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeprovisioned', 'ProvisioningStateMoving', 'ProvisioningStateSuspended', 'ProvisioningStateWarned', 'ProvisioningStateSystemMaintenance'
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
// AccessPolicies - Fhir Service access policies.
AccessPolicies *[]FhirServiceAccessPolicyEntry `json:"accessPolicies,omitempty"`
// AcrConfiguration - Fhir Service Azure container registry configuration.
AcrConfiguration *FhirServiceAcrConfiguration `json:"acrConfiguration,omitempty"`
// AuthenticationConfiguration - Fhir Service authentication configuration.
AuthenticationConfiguration *FhirServiceAuthenticationConfiguration `json:"authenticationConfiguration,omitempty"`
// CorsConfiguration - Fhir Service Cors configuration.
CorsConfiguration *FhirServiceCorsConfiguration `json:"corsConfiguration,omitempty"`
// ExportConfiguration - Fhir Service export configuration.
ExportConfiguration *FhirServiceExportConfiguration `json:"exportConfiguration,omitempty"`
}
// FhirServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type FhirServicesCreateOrUpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(FhirServicesClient) (FhirService, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *FhirServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for FhirServicesCreateOrUpdateFuture.Result.
func (future *FhirServicesCreateOrUpdateFuture) result(client FhirServicesClient) (fs FhirService, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
fs.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("healthcareapis.FhirServicesCreateOrUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if fs.Response.Response, err = future.GetResult(sender); err == nil && fs.Response.Response.StatusCode != http.StatusNoContent {
fs, err = client.CreateOrUpdateResponder(fs.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesCreateOrUpdateFuture", "Result", fs.Response.Response, "Failure responding to request")
}
}
return
}
// FhirServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type FhirServicesDeleteFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(FhirServicesClient) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *FhirServicesDeleteFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for FhirServicesDeleteFuture.Result.
func (future *FhirServicesDeleteFuture) result(client FhirServicesClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("healthcareapis.FhirServicesDeleteFuture")
return
}
ar.Response = future.Response()
return
}
// FhirServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type FhirServicesUpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(FhirServicesClient) (FhirService, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *FhirServicesUpdateFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for FhirServicesUpdateFuture.Result.
func (future *FhirServicesUpdateFuture) result(client FhirServicesClient) (fs FhirService, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
fs.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("healthcareapis.FhirServicesUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if fs.Response.Response, err = future.GetResult(sender); err == nil && fs.Response.Response.StatusCode != http.StatusNoContent {
fs, err = client.UpdateResponder(fs.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesUpdateFuture", "Result", fs.Response.Response, "Failure responding to request")
}
}
return
}
// IotConnector ioT Connector definition.
type IotConnector struct {
autorest.Response `json:"-"`
// Tags - Resource tags.
Tags map[string]*string `json:"tags"`
// Location - The resource location.
Location *string `json:"location,omitempty"`
// Identity - Setting indicating whether the service has a managed identity associated with it.
Identity *ServiceManagedIdentityIdentity `json:"identity,omitempty"`
// IotConnectorProperties - IoT Connector configuration.
*IotConnectorProperties `json:"properties,omitempty"`
// SystemData - Metadata pertaining to creation and last modification of the resource.
SystemData *SystemData `json:"systemData,omitempty"`
}
// MarshalJSON is the custom marshaler for IotConnector.
func (ic IotConnector) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ic.Tags != nil {
objectMap["tags"] = ic.Tags
}
if ic.Location != nil {
objectMap["location"] = ic.Location
}
if ic.Identity != nil {
objectMap["identity"] = ic.Identity
}
if ic.IotConnectorProperties != nil {
objectMap["properties"] = ic.IotConnectorProperties
}
if ic.SystemData != nil {
objectMap["systemData"] = ic.SystemData
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for IotConnector struct.
func (ic *IotConnector) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage