-
Notifications
You must be signed in to change notification settings - Fork 822
/
models.go
1163 lines (1050 loc) · 49.2 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 search
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// 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/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/search/mgmt/2020-03-13/search"
// AdminKeyResult response containing the primary and secondary admin API keys for a given Azure Cognitive
// Search service.
type AdminKeyResult struct {
autorest.Response `json:"-"`
// PrimaryKey - READ-ONLY; The primary admin API key of the Search service.
PrimaryKey *string `json:"primaryKey,omitempty"`
// SecondaryKey - READ-ONLY; The secondary admin API key of the Search service.
SecondaryKey *string `json:"secondaryKey,omitempty"`
}
// CheckNameAvailabilityInput input of check name availability API.
type CheckNameAvailabilityInput struct {
// Name - The Search service name to validate. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length.
Name *string `json:"name,omitempty"`
// Type - The type of the resource whose name is to be validated. This value must always be 'searchServices'.
Type *string `json:"type,omitempty"`
}
// CheckNameAvailabilityOutput output of check name availability API.
type CheckNameAvailabilityOutput struct {
autorest.Response `json:"-"`
// IsNameAvailable - READ-ONLY; A value indicating whether the name is available.
IsNameAvailable *bool `json:"nameAvailable,omitempty"`
// Reason - READ-ONLY; The reason why the name is not available. 'Invalid' indicates the name provided does not match the naming requirements (incorrect length, unsupported characters, etc.). 'AlreadyExists' indicates that the name is already in use and is therefore unavailable. Possible values include: 'Invalid', 'AlreadyExists'
Reason UnavailableNameReason `json:"reason,omitempty"`
// Message - READ-ONLY; A message that explains why the name is invalid and provides resource naming requirements. Available only if 'Invalid' is returned in the 'reason' property.
Message *string `json:"message,omitempty"`
}
// CloudError contains information about an API error.
type CloudError struct {
// Error - Describes a particular API error with an error code and a message.
Error *CloudErrorBody `json:"error,omitempty"`
}
// CloudErrorBody describes a particular API error with an error code and a message.
type CloudErrorBody struct {
// Code - An error code that describes the error condition more precisely than an HTTP status code. Can be used to programmatically handle specific error cases.
Code *string `json:"code,omitempty"`
// Message - A message that describes the error in detail and provides debugging information.
Message *string `json:"message,omitempty"`
// Target - The target of the particular error (for example, the name of the property in error).
Target *string `json:"target,omitempty"`
// Details - Contains nested errors that are related to this error.
Details *[]CloudErrorBody `json:"details,omitempty"`
}
// Identity identity for the resource.
type Identity struct {
// PrincipalID - READ-ONLY; The principal ID of resource identity.
PrincipalID *string `json:"principalId,omitempty"`
// TenantID - READ-ONLY; The tenant ID of resource.
TenantID *string `json:"tenantId,omitempty"`
// Type - The identity type. Possible values include: 'None', 'SystemAssigned'
Type IdentityType `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for Identity.
func (i Identity) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if i.Type != "" {
objectMap["type"] = i.Type
}
return json.Marshal(objectMap)
}
// IPRule the IP restriction rule of the Azure Cognitive Search service.
type IPRule struct {
// Value - Value corresponding to a single IPv4 address (eg., 123.1.2.3) or an IP range in CIDR format (eg., 123.1.2.3/24) to be allowed.
Value *string `json:"value,omitempty"`
}
// ListQueryKeysResult response containing the query API keys for a given Azure Cognitive Search service.
type ListQueryKeysResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; The query keys for the Azure Cognitive Search service.
Value *[]QueryKey `json:"value,omitempty"`
// NextLink - READ-ONLY; Request URL that can be used to query next page of query keys. Returned when the total number of requested query keys exceed maximum page size.
NextLink *string `json:"nextLink,omitempty"`
}
// ListQueryKeysResultIterator provides access to a complete listing of QueryKey values.
type ListQueryKeysResultIterator struct {
i int
page ListQueryKeysResultPage
}
// 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 *ListQueryKeysResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ListQueryKeysResultIterator.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 *ListQueryKeysResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ListQueryKeysResultIterator) 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 ListQueryKeysResultIterator) Response() ListQueryKeysResult {
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 ListQueryKeysResultIterator) Value() QueryKey {
if !iter.page.NotDone() {
return QueryKey{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the ListQueryKeysResultIterator type.
func NewListQueryKeysResultIterator(page ListQueryKeysResultPage) ListQueryKeysResultIterator {
return ListQueryKeysResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (lqkr ListQueryKeysResult) IsEmpty() bool {
return lqkr.Value == nil || len(*lqkr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (lqkr ListQueryKeysResult) hasNextLink() bool {
return lqkr.NextLink != nil && len(*lqkr.NextLink) != 0
}
// listQueryKeysResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (lqkr ListQueryKeysResult) listQueryKeysResultPreparer(ctx context.Context) (*http.Request, error) {
if !lqkr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(lqkr.NextLink)))
}
// ListQueryKeysResultPage contains a page of QueryKey values.
type ListQueryKeysResultPage struct {
fn func(context.Context, ListQueryKeysResult) (ListQueryKeysResult, error)
lqkr ListQueryKeysResult
}
// 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 *ListQueryKeysResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ListQueryKeysResultPage.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.lqkr)
if err != nil {
return err
}
page.lqkr = 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 *ListQueryKeysResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ListQueryKeysResultPage) NotDone() bool {
return !page.lqkr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page ListQueryKeysResultPage) Response() ListQueryKeysResult {
return page.lqkr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page ListQueryKeysResultPage) Values() []QueryKey {
if page.lqkr.IsEmpty() {
return nil
}
return *page.lqkr.Value
}
// Creates a new instance of the ListQueryKeysResultPage type.
func NewListQueryKeysResultPage(getNextPage func(context.Context, ListQueryKeysResult) (ListQueryKeysResult, error)) ListQueryKeysResultPage {
return ListQueryKeysResultPage{fn: getNextPage}
}
// NetworkRuleSet network specific rules that determine how the Azure Cognitive Search service may be reached.
type NetworkRuleSet struct {
// IPRules - A list of IP restriction rules that defines the inbound network(s) with allowing access to the search service endpoint. At the meantime, all other public IP networks are blocked by the firewall. These restriction rules are applied only when the 'publicNetworkAccess' of the search service is 'enabled'; otherwise, traffic over public interface is not allowed even with any public IP rules, and private endpoint connections would be the exclusive access method.
IPRules *[]IPRule `json:"ipRules,omitempty"`
}
// Operation describes a REST API operation.
type Operation struct {
// Name - READ-ONLY; The name of the operation. This name is of the form {provider}/{resource}/{operation}.
Name *string `json:"name,omitempty"`
// Display - READ-ONLY; The object that describes the operation.
Display *OperationDisplay `json:"display,omitempty"`
}
// OperationDisplay the object that describes the operation.
type OperationDisplay struct {
// Provider - READ-ONLY; The friendly name of the resource provider.
Provider *string `json:"provider,omitempty"`
// Operation - READ-ONLY; The operation type: read, write, delete, listKeys/action, etc.
Operation *string `json:"operation,omitempty"`
// Resource - READ-ONLY; The resource type on which the operation is performed.
Resource *string `json:"resource,omitempty"`
// Description - READ-ONLY; The friendly name of the operation.
Description *string `json:"description,omitempty"`
}
// OperationListResult the result of the request to list REST API operations. It contains a list of operations
// and a URL to get the next set of results.
type OperationListResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; The list of operations supported by the resource provider.
Value *[]Operation `json:"value,omitempty"`
// NextLink - READ-ONLY; The URL to get the next set of operation list results, if any.
NextLink *string `json:"nextLink,omitempty"`
}
// PrivateEndpointConnection describes an existing Private Endpoint connection to the Azure Cognitive Search
// service.
type PrivateEndpointConnection struct {
autorest.Response `json:"-"`
// ID - READ-ONLY; The ID of the private endpoint connection. This can be used with the Azure Resource Manager to link resources together.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the private endpoint connection.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The resource type.
Type *string `json:"type,omitempty"`
// Properties - Describes the properties of an existing Private Endpoint connection to the Azure Cognitive Search service.
Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for PrivateEndpointConnection.
func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if pec.Properties != nil {
objectMap["properties"] = pec.Properties
}
return json.Marshal(objectMap)
}
// PrivateEndpointConnectionListResult response containing a list of Private Endpoint connections.
type PrivateEndpointConnectionListResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; The list of Private Endpoint connections.
Value *[]PrivateEndpointConnection `json:"value,omitempty"`
// NextLink - READ-ONLY; Request URL that can be used to query next page of private endpoint connections. Returned when the total number of requested private endpoint connections exceed maximum page size.
NextLink *string `json:"nextLink,omitempty"`
}
// PrivateEndpointConnectionListResultIterator provides access to a complete listing of
// PrivateEndpointConnection values.
type PrivateEndpointConnectionListResultIterator struct {
i int
page PrivateEndpointConnectionListResultPage
}
// 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 *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.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 *PrivateEndpointConnectionListResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter PrivateEndpointConnectionListResultIterator) 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 PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult {
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 PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection {
if !iter.page.NotDone() {
return PrivateEndpointConnection{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the PrivateEndpointConnectionListResultIterator type.
func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator {
return PrivateEndpointConnectionListResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool {
return peclr.Value == nil || len(*peclr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool {
return peclr.NextLink != nil && len(*peclr.NextLink) != 0
}
// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) {
if !peclr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(peclr.NextLink)))
}
// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values.
type PrivateEndpointConnectionListResultPage struct {
fn func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)
peclr PrivateEndpointConnectionListResult
}
// 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 *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.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.peclr)
if err != nil {
return err
}
page.peclr = 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 *PrivateEndpointConnectionListResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page PrivateEndpointConnectionListResultPage) NotDone() bool {
return !page.peclr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult {
return page.peclr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection {
if page.peclr.IsEmpty() {
return nil
}
return *page.peclr.Value
}
// Creates a new instance of the PrivateEndpointConnectionListResultPage type.
func NewPrivateEndpointConnectionListResultPage(getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage {
return PrivateEndpointConnectionListResultPage{fn: getNextPage}
}
// PrivateEndpointConnectionProperties describes the properties of an existing Private Endpoint connection to
// the Azure Cognitive Search service.
type PrivateEndpointConnectionProperties struct {
// PrivateEndpoint - The private endpoint resource from Microsoft.Network provider.
PrivateEndpoint *PrivateEndpointConnectionPropertiesPrivateEndpoint `json:"privateEndpoint,omitempty"`
// PrivateLinkServiceConnectionState - Describes the current state of an existing Private Link Service connection to the Azure Private Endpoint.
PrivateLinkServiceConnectionState *PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
}
// PrivateEndpointConnectionPropertiesPrivateEndpoint the private endpoint resource from Microsoft.Network
// provider.
type PrivateEndpointConnectionPropertiesPrivateEndpoint struct {
// ID - The resource id of the private endpoint resource from Microsoft.Network provider.
ID *string `json:"id,omitempty"`
}
// PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState describes the current state of an
// existing Private Link Service connection to the Azure Private Endpoint.
type PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState struct {
// Status - Status of the the private link service connection. Can be Pending, Approved, Rejected, or Disconnected. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'
Status PrivateLinkServiceConnectionStatus `json:"status,omitempty"`
// Description - The description for the private link service connection state.
Description *string `json:"description,omitempty"`
// ActionsRequired - A description of any extra actions that may be required.
ActionsRequired *string `json:"actionsRequired,omitempty"`
}
// PrivateLinkResource describes a supported private link resource for the Azure Cognitive Search service.
type PrivateLinkResource struct {
// ID - READ-ONLY; The ID of the private link resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the private link resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The resource type.
Type *string `json:"type,omitempty"`
// Properties - READ-ONLY; Describes the properties of a supported private link resource for the Azure Cognitive Search service.
Properties *PrivateLinkResourceProperties `json:"properties,omitempty"`
}
// PrivateLinkResourceProperties describes the properties of a supported private link resource for the Azure
// Cognitive Search service. For a given API version, this represents the 'supported' groupIds when creating a
// shared private link resource.
type PrivateLinkResourceProperties struct {
// GroupID - READ-ONLY; The group ID of the private link resource.
GroupID *string `json:"groupId,omitempty"`
// RequiredMembers - READ-ONLY; The list of required members of the private link resource.
RequiredMembers *[]string `json:"requiredMembers,omitempty"`
// RequiredZoneNames - READ-ONLY; The list of required DNS zone names of the private link resource.
RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
// ShareablePrivateLinkResourceTypes - READ-ONLY; The list of resources that are onboarded to private link service, that are supported by Azure Cognitive Search.
ShareablePrivateLinkResourceTypes *[]ShareablePrivateLinkResourceType `json:"shareablePrivateLinkResourceTypes,omitempty"`
}
// PrivateLinkResourcesResult response containing a list of supported Private Link Resources.
type PrivateLinkResourcesResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; The list of supported Private Link Resources.
Value *[]PrivateLinkResource `json:"value,omitempty"`
}
// QueryKey describes an API key for a given Azure Cognitive Search service that has permissions for query
// operations only.
type QueryKey struct {
autorest.Response `json:"-"`
// Name - READ-ONLY; The name of the query API key; may be empty.
Name *string `json:"name,omitempty"`
// Key - READ-ONLY; The value of the query API key.
Key *string `json:"key,omitempty"`
}
// Resource base type for all Azure resources.
type Resource struct {
// ID - READ-ONLY; The ID of the resource. This can be used with the Azure Resource Manager to link resources together.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The resource type.
Type *string `json:"type,omitempty"`
// Location - The geographic location of the resource. This must be one of the supported and registered Azure Geo Regions (for example, West US, East US, Southeast Asia, and so forth). This property is required when creating a new resource.
Location *string `json:"location,omitempty"`
// Tags - Tags to help categorize the resource in the Azure portal.
Tags map[string]*string `json:"tags"`
// Identity - The identity of the resource.
Identity *Identity `json:"identity,omitempty"`
}
// MarshalJSON is the custom marshaler for Resource.
func (r Resource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if r.Location != nil {
objectMap["location"] = r.Location
}
if r.Tags != nil {
objectMap["tags"] = r.Tags
}
if r.Identity != nil {
objectMap["identity"] = r.Identity
}
return json.Marshal(objectMap)
}
// Service describes an Azure Cognitive Search service and its current state.
type Service struct {
autorest.Response `json:"-"`
// ServiceProperties - Properties of the Search service.
*ServiceProperties `json:"properties,omitempty"`
// Sku - The SKU of the Search Service, which determines price tier and capacity limits. This property is required when creating a new Search Service.
Sku *Sku `json:"sku,omitempty"`
// ID - READ-ONLY; The ID of the resource. This can be used with the Azure Resource Manager to link resources together.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The resource type.
Type *string `json:"type,omitempty"`
// Location - The geographic location of the resource. This must be one of the supported and registered Azure Geo Regions (for example, West US, East US, Southeast Asia, and so forth). This property is required when creating a new resource.
Location *string `json:"location,omitempty"`
// Tags - Tags to help categorize the resource in the Azure portal.
Tags map[string]*string `json:"tags"`
// Identity - The identity of the resource.
Identity *Identity `json:"identity,omitempty"`
}
// MarshalJSON is the custom marshaler for Service.
func (s Service) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if s.ServiceProperties != nil {
objectMap["properties"] = s.ServiceProperties
}
if s.Sku != nil {
objectMap["sku"] = s.Sku
}
if s.Location != nil {
objectMap["location"] = s.Location
}
if s.Tags != nil {
objectMap["tags"] = s.Tags
}
if s.Identity != nil {
objectMap["identity"] = s.Identity
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Service struct.
func (s *Service) 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 serviceProperties ServiceProperties
err = json.Unmarshal(*v, &serviceProperties)
if err != nil {
return err
}
s.ServiceProperties = &serviceProperties
}
case "sku":
if v != nil {
var sku Sku
err = json.Unmarshal(*v, &sku)
if err != nil {
return err
}
s.Sku = &sku
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
s.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
s.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
s.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
s.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
s.Tags = tags
}
case "identity":
if v != nil {
var identity Identity
err = json.Unmarshal(*v, &identity)
if err != nil {
return err
}
s.Identity = &identity
}
}
}
return nil
}
// ServiceListResult response containing a list of Azure Cognitive Search services.
type ServiceListResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; The list of Search services.
Value *[]Service `json:"value,omitempty"`
// NextLink - READ-ONLY; Request URL that can be used to query next page of search services. Returned when the total number of requested search services exceed maximum page size.
NextLink *string `json:"nextLink,omitempty"`
}
// ServiceListResultIterator provides access to a complete listing of Service values.
type ServiceListResultIterator struct {
i int
page ServiceListResultPage
}
// 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 *ServiceListResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultIterator.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 *ServiceListResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ServiceListResultIterator) 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 ServiceListResultIterator) Response() ServiceListResult {
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 ServiceListResultIterator) Value() Service {
if !iter.page.NotDone() {
return Service{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the ServiceListResultIterator type.
func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator {
return ServiceListResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (slr ServiceListResult) IsEmpty() bool {
return slr.Value == nil || len(*slr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (slr ServiceListResult) hasNextLink() bool {
return slr.NextLink != nil && len(*slr.NextLink) != 0
}
// serviceListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) {
if !slr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(slr.NextLink)))
}
// ServiceListResultPage contains a page of Service values.
type ServiceListResultPage struct {
fn func(context.Context, ServiceListResult) (ServiceListResult, error)
slr ServiceListResult
}
// 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 *ServiceListResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultPage.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.slr)
if err != nil {
return err
}
page.slr = 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 *ServiceListResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ServiceListResultPage) NotDone() bool {
return !page.slr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page ServiceListResultPage) Response() ServiceListResult {
return page.slr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page ServiceListResultPage) Values() []Service {
if page.slr.IsEmpty() {
return nil
}
return *page.slr.Value
}
// Creates a new instance of the ServiceListResultPage type.
func NewServiceListResultPage(getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage {
return ServiceListResultPage{fn: getNextPage}
}
// ServiceProperties properties of the Search service.
type ServiceProperties struct {
// ReplicaCount - The number of replicas in the Search service. If specified, it must be a value between 1 and 12 inclusive for standard SKUs or between 1 and 3 inclusive for basic SKU.
ReplicaCount *int32 `json:"replicaCount,omitempty"`
// PartitionCount - The number of partitions in the Search service; if specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are only valid for standard SKUs. For 'standard3' services with hostingMode set to 'highDensity', the allowed values are between 1 and 3.
PartitionCount *int32 `json:"partitionCount,omitempty"`
// HostingMode - Applicable only for the standard3 SKU. You can set this property to enable up to 3 high density partitions that allow up to 1000 indexes, which is much higher than the maximum indexes allowed for any other SKU. For the standard3 SKU, the value is either 'default' or 'highDensity'. For all other SKUs, this value must be 'default'. Possible values include: 'Default', 'HighDensity'
HostingMode HostingMode `json:"hostingMode,omitempty"`
// PublicNetworkAccess - This value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method. Possible values include: 'Enabled', 'Disabled'
PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
// Status - READ-ONLY; The status of the Search service. Possible values include: 'running': The Search service is running and no provisioning operations are underway. 'provisioning': The Search service is being provisioned or scaled up or down. 'deleting': The Search service is being deleted. 'degraded': The Search service is degraded. This can occur when the underlying search units are not healthy. The Search service is most likely operational, but performance might be slow and some requests might be dropped. 'disabled': The Search service is disabled. In this state, the service will reject all API requests. 'error': The Search service is in an error state. If your service is in the degraded, disabled, or error states, it means the Azure Cognitive Search team is actively investigating the underlying issue. Dedicated services in these states are still chargeable based on the number of search units provisioned. Possible values include: 'ServiceStatusRunning', 'ServiceStatusProvisioning', 'ServiceStatusDeleting', 'ServiceStatusDegraded', 'ServiceStatusDisabled', 'ServiceStatusError'
Status ServiceStatus `json:"status,omitempty"`
// StatusDetails - READ-ONLY; The details of the Search service status.
StatusDetails *string `json:"statusDetails,omitempty"`
// ProvisioningState - READ-ONLY; The state of the last provisioning operation performed on the Search service. Provisioning is an intermediate state that occurs while service capacity is being established. After capacity is set up, provisioningState changes to either 'succeeded' or 'failed'. Client applications can poll provisioning status (the recommended polling interval is from 30 seconds to one minute) by using the Get Search Service operation to see when an operation is completed. If you are using the free service, this value tends to come back as 'succeeded' directly in the call to Create Search service. This is because the free service uses capacity that is already set up. Possible values include: 'Succeeded', 'Provisioning', 'Failed'
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
// NetworkRuleSet - Network specific rules that determine how the Azure Cognitive Search service may be reached.
NetworkRuleSet *NetworkRuleSet `json:"networkRuleSet,omitempty"`
// PrivateEndpointConnections - READ-ONLY; The list of private endpoint connections to the Azure Cognitive Search service.
PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
// SharedPrivateLinkResources - READ-ONLY; The list of shared private link resources managed by the Azure Cognitive Search service.
SharedPrivateLinkResources *[]SharedPrivateLinkResource `json:"sharedPrivateLinkResources,omitempty"`
}
// MarshalJSON is the custom marshaler for ServiceProperties.
func (sp ServiceProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if sp.ReplicaCount != nil {
objectMap["replicaCount"] = sp.ReplicaCount
}
if sp.PartitionCount != nil {
objectMap["partitionCount"] = sp.PartitionCount
}
if sp.HostingMode != "" {
objectMap["hostingMode"] = sp.HostingMode
}
if sp.PublicNetworkAccess != "" {
objectMap["publicNetworkAccess"] = sp.PublicNetworkAccess
}
if sp.NetworkRuleSet != nil {
objectMap["networkRuleSet"] = sp.NetworkRuleSet
}
return json.Marshal(objectMap)
}
// ServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type ServicesCreateOrUpdateFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *ServicesCreateOrUpdateFuture) Result(client ServicesClient) (s Service, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "search.ServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("search.ServicesCreateOrUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
s, err = client.CreateOrUpdateResponder(s.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "search.ServicesCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request")
}
}
return
}
// ShareablePrivateLinkResourceProperties describes the properties of a resource type that has been onboarded
// to private link service, supported by Azure Cognitive Search.
type ShareablePrivateLinkResourceProperties struct {
// Type - READ-ONLY; The resource provider type for the resource that has been onboarded to private link service, supported by Azure Cognitive Search.
Type *string `json:"type,omitempty"`
// GroupID - READ-ONLY; The resource provider group id for the resource that has been onboarded to private link service, supported by Azure Cognitive Search.
GroupID *string `json:"groupId,omitempty"`
// Description - READ-ONLY; The description of the resource type that has been onboarded to private link service, supported by Azure Cognitive Search.
Description *string `json:"description,omitempty"`
}
// ShareablePrivateLinkResourceType describes an resource type that has been onboarded to private link service,
// supported by Azure Cognitive Search.
type ShareablePrivateLinkResourceType struct {
// Name - READ-ONLY; The name of the resource type that has been onboarded to private link service, supported by Azure Cognitive Search.
Name *string `json:"name,omitempty"`
// Properties - READ-ONLY; Describes the properties of a resource type that has been onboarded to private link service, supported by Azure Cognitive Search.
Properties *ShareablePrivateLinkResourceProperties `json:"properties,omitempty"`
}
// SharedPrivateLinkResource describes a Shared Private Link Resource managed by the Azure Cognitive Search
// service.
type SharedPrivateLinkResource struct {
autorest.Response `json:"-"`
// Name - READ-ONLY; The name of the shared private link resource.
Name *string `json:"name,omitempty"`
// ID - READ-ONLY; The ID of the shared private link resource.
ID *string `json:"id,omitempty"`
// Type - READ-ONLY; The resource type.
Type *string `json:"type,omitempty"`
// Properties - Describes the properties of a Shared Private Link Resource managed by the Azure Cognitive Search service.
Properties *SharedPrivateLinkResourceProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for SharedPrivateLinkResource.
func (splr SharedPrivateLinkResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if splr.Properties != nil {
objectMap["properties"] = splr.Properties
}
return json.Marshal(objectMap)
}
// SharedPrivateLinkResourceListResult response containing a list of Shared Private Link Resources.
type SharedPrivateLinkResourceListResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; The list of Shared Private Link Resources.
Value *[]SharedPrivateLinkResource `json:"value,omitempty"`
// NextLink - The URL to get the next set of shared private link resources, if there are any.
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for SharedPrivateLinkResourceListResult.
func (splrlr SharedPrivateLinkResourceListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if splrlr.NextLink != nil {
objectMap["nextLink"] = splrlr.NextLink
}
return json.Marshal(objectMap)
}
// SharedPrivateLinkResourceListResultIterator provides access to a complete listing of
// SharedPrivateLinkResource values.
type SharedPrivateLinkResourceListResultIterator struct {