@azure/arm-redisenterprisecache 2.1.1-alpha.20221128.1 → 2.2.0-alpha.20221214.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +12 -10
  2. package/dist/index.js +245 -49
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.min.js +1 -1
  5. package/dist/index.min.js.map +1 -1
  6. package/dist-esm/src/index.d.ts +1 -0
  7. package/dist-esm/src/index.d.ts.map +1 -1
  8. package/dist-esm/src/index.js +1 -0
  9. package/dist-esm/src/index.js.map +1 -1
  10. package/dist-esm/src/models/index.d.ts +73 -11
  11. package/dist-esm/src/models/index.d.ts.map +1 -1
  12. package/dist-esm/src/models/index.js +61 -0
  13. package/dist-esm/src/models/index.js.map +1 -1
  14. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  15. package/dist-esm/src/models/parameters.js +6 -0
  16. package/dist-esm/src/models/parameters.js.map +1 -1
  17. package/dist-esm/src/operations/databases.d.ts.map +1 -1
  18. package/dist-esm/src/operations/databases.js +19 -8
  19. package/dist-esm/src/operations/databases.js.map +1 -1
  20. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  21. package/dist-esm/src/operations/operations.js +19 -8
  22. package/dist-esm/src/operations/operations.js.map +1 -1
  23. package/dist-esm/src/operations/operationsStatus.d.ts +2 -2
  24. package/dist-esm/src/operations/operationsStatus.js +2 -2
  25. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -1
  26. package/dist-esm/src/operations/privateEndpointConnections.js +8 -4
  27. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -1
  28. package/dist-esm/src/operations/privateLinkResources.d.ts.map +1 -1
  29. package/dist-esm/src/operations/privateLinkResources.js +8 -4
  30. package/dist-esm/src/operations/privateLinkResources.js.map +1 -1
  31. package/dist-esm/src/operations/redisEnterprise.d.ts.map +1 -1
  32. package/dist-esm/src/operations/redisEnterprise.js +37 -16
  33. package/dist-esm/src/operations/redisEnterprise.js.map +1 -1
  34. package/dist-esm/src/operationsInterfaces/operationsStatus.d.ts +2 -2
  35. package/dist-esm/src/pagingHelper.d.ts +13 -0
  36. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  37. package/dist-esm/src/pagingHelper.js +32 -0
  38. package/dist-esm/src/pagingHelper.js.map +1 -0
  39. package/dist-esm/src/redisEnterpriseManagementClient.d.ts +2 -0
  40. package/dist-esm/src/redisEnterpriseManagementClient.d.ts.map +1 -1
  41. package/dist-esm/src/redisEnterpriseManagementClient.js +54 -6
  42. package/dist-esm/src/redisEnterpriseManagementClient.js.map +1 -1
  43. package/dist-esm/test/sampleTest.js +11 -13
  44. package/dist-esm/test/sampleTest.js.map +1 -1
  45. package/package.json +13 -9
  46. package/review/arm-redisenterprisecache.api.md +26 -83
  47. package/src/index.ts +1 -0
  48. package/src/models/index.ts +72 -11
  49. package/src/models/parameters.ts +6 -0
  50. package/src/operations/databases.ts +26 -13
  51. package/src/operations/operations.ts +21 -9
  52. package/src/operations/operationsStatus.ts +2 -2
  53. package/src/operations/privateEndpointConnections.ts +15 -5
  54. package/src/operations/privateLinkResources.ts +11 -9
  55. package/src/operations/redisEnterprise.ts +46 -19
  56. package/src/operationsInterfaces/operationsStatus.ts +2 -2
  57. package/src/pagingHelper.ts +39 -0
  58. package/src/redisEnterpriseManagementClient.ts +69 -5
  59. package/types/arm-redisenterprisecache.d.ts +86 -13
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ export interface PageInfo {
10
+ continuationToken?: string;
11
+ }
12
+
13
+ const pageMap = new WeakMap<object, PageInfo>();
14
+
15
+ /**
16
+ * Given the last `.value` produced by the `byPage` iterator,
17
+ * returns a continuation token that can be used to begin paging from
18
+ * that point later.
19
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
20
+ * @returns The continuation token that can be passed into byPage() during future calls.
21
+ */
22
+ export function getContinuationToken(page: unknown): string | undefined {
23
+ if (typeof page !== "object" || page === null) {
24
+ return undefined;
25
+ }
26
+ return pageMap.get(page)?.continuationToken;
27
+ }
28
+
29
+ export function setContinuationToken(
30
+ page: unknown,
31
+ continuationToken: string | undefined
32
+ ): void {
33
+ if (typeof page !== "object" || page === null || !continuationToken) {
34
+ return;
35
+ }
36
+ const pageInfo = pageMap.get(page) ?? {};
37
+ pageInfo.continuationToken = continuationToken;
38
+ pageMap.set(page, pageInfo);
39
+ }
@@ -7,6 +7,12 @@
7
7
  */
8
8
 
9
9
  import * as coreClient from "@azure/core-client";
10
+ import * as coreRestPipeline from "@azure/core-rest-pipeline";
11
+ import {
12
+ PipelineRequest,
13
+ PipelineResponse,
14
+ SendRequest
15
+ } from "@azure/core-rest-pipeline";
10
16
  import * as coreAuth from "@azure/core-auth";
11
17
  import {
12
18
  OperationsImpl,
@@ -58,25 +64,54 @@ export class RedisEnterpriseManagementClient extends coreClient.ServiceClient {
58
64
  credential: credentials
59
65
  };
60
66
 
61
- const packageDetails = `azsdk-js-arm-redisenterprisecache/2.1.1`;
67
+ const packageDetails = `azsdk-js-arm-redisenterprisecache/2.2.0`;
62
68
  const userAgentPrefix =
63
69
  options.userAgentOptions && options.userAgentOptions.userAgentPrefix
64
70
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
65
71
  : `${packageDetails}`;
66
72
 
67
- if (!options.credentialScopes) {
68
- options.credentialScopes = ["https://management.azure.com/.default"];
69
- }
70
73
  const optionsWithDefaults = {
71
74
  ...defaults,
72
75
  ...options,
73
76
  userAgentOptions: {
74
77
  userAgentPrefix
75
78
  },
76
- baseUri:
79
+ endpoint:
77
80
  options.endpoint ?? options.baseUri ?? "https://management.azure.com"
78
81
  };
79
82
  super(optionsWithDefaults);
83
+
84
+ let bearerTokenAuthenticationPolicyFound: boolean = false;
85
+ if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
86
+ const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
87
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
88
+ (pipelinePolicy) =>
89
+ pipelinePolicy.name ===
90
+ coreRestPipeline.bearerTokenAuthenticationPolicyName
91
+ );
92
+ }
93
+ if (
94
+ !options ||
95
+ !options.pipeline ||
96
+ options.pipeline.getOrderedPolicies().length == 0 ||
97
+ !bearerTokenAuthenticationPolicyFound
98
+ ) {
99
+ this.pipeline.removePolicy({
100
+ name: coreRestPipeline.bearerTokenAuthenticationPolicyName
101
+ });
102
+ this.pipeline.addPolicy(
103
+ coreRestPipeline.bearerTokenAuthenticationPolicy({
104
+ credential: credentials,
105
+ scopes:
106
+ optionsWithDefaults.credentialScopes ??
107
+ `${optionsWithDefaults.endpoint}/.default`,
108
+ challengeCallbacks: {
109
+ authorizeRequestOnChallenge:
110
+ coreClient.authorizeRequestOnClaimChallenge
111
+ }
112
+ })
113
+ );
114
+ }
80
115
  // Parameter assignments
81
116
  this.subscriptionId = subscriptionId;
82
117
 
@@ -89,6 +124,35 @@ export class RedisEnterpriseManagementClient extends coreClient.ServiceClient {
89
124
  this.databases = new DatabasesImpl(this);
90
125
  this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this);
91
126
  this.privateLinkResources = new PrivateLinkResourcesImpl(this);
127
+ this.addCustomApiVersionPolicy(options.apiVersion);
128
+ }
129
+
130
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
131
+ private addCustomApiVersionPolicy(apiVersion?: string) {
132
+ if (!apiVersion) {
133
+ return;
134
+ }
135
+ const apiVersionPolicy = {
136
+ name: "CustomApiVersionPolicy",
137
+ async sendRequest(
138
+ request: PipelineRequest,
139
+ next: SendRequest
140
+ ): Promise<PipelineResponse> {
141
+ const param = request.url.split("?");
142
+ if (param.length > 1) {
143
+ const newParams = param[1].split("&").map((item) => {
144
+ if (item.indexOf("api-version") > -1) {
145
+ return "api-version=" + apiVersion;
146
+ } else {
147
+ return item;
148
+ }
149
+ });
150
+ request.url = param[0] + "?" + newParams.join("&");
151
+ }
152
+ return next(request);
153
+ }
154
+ };
155
+ this.pipeline.addPolicy(apiVersionPolicy);
92
156
  }
93
157
 
94
158
  operations: Operations;
@@ -41,7 +41,7 @@ export declare type ActionType = string;
41
41
  export declare type AofFrequency = string;
42
42
 
43
43
  /** Describes the RedisEnterprise cluster */
44
- export declare type Cluster = TrackedResource & {
44
+ export declare interface Cluster extends TrackedResource {
45
45
  /** The SKU to create, which affects price, performance, and features. */
46
46
  sku: Sku;
47
47
  /** The Availability Zones where this cluster will be deployed. */
@@ -73,7 +73,7 @@ export declare type Cluster = TrackedResource & {
73
73
  * NOTE: This property will not be serialized. It can only be populated by the server.
74
74
  */
75
75
  readonly privateEndpointConnections?: PrivateEndpointConnection[];
76
- };
76
+ }
77
77
 
78
78
  /**
79
79
  * Defines values for ClusteringPolicy. \
@@ -134,7 +134,7 @@ export declare interface ClusterUpdate {
134
134
  }
135
135
 
136
136
  /** Describes a database on the RedisEnterprise cluster */
137
- export declare type Database = ProxyResource & {
137
+ export declare interface Database extends ProxyResource {
138
138
  /** Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted. */
139
139
  clientProtocol?: Protocol;
140
140
  /** TCP port of the database endpoint. Specified at create time. Defaults to an available port. */
@@ -159,7 +159,7 @@ export declare type Database = ProxyResource & {
159
159
  modules?: Module[];
160
160
  /** Optional set of properties to configure geo replication for this database. */
161
161
  geoReplication?: DatabasePropertiesGeoReplication;
162
- };
162
+ }
163
163
 
164
164
  /** The response of a list-all operation. */
165
165
  export declare interface DatabaseList {
@@ -529,6 +529,15 @@ export declare interface ForceUnlinkParameters {
529
529
  ids: string[];
530
530
  }
531
531
 
532
+ /**
533
+ * Given the last `.value` produced by the `byPage` iterator,
534
+ * returns a continuation token that can be used to begin paging from
535
+ * that point later.
536
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
537
+ * @returns The continuation token that can be passed into byPage() during future calls.
538
+ */
539
+ export declare function getContinuationToken(page: unknown): string | undefined;
540
+
532
541
  /** Parameters for a Redis Enterprise import operation. */
533
542
  export declare interface ImportClusterParameters {
534
543
  /** SAS URIs for the target blobs to import from */
@@ -537,118 +546,179 @@ export declare interface ImportClusterParameters {
537
546
 
538
547
  /** Known values of {@link ActionType} that the service accepts. */
539
548
  export declare enum KnownActionType {
549
+ /** Internal */
540
550
  Internal = "Internal"
541
551
  }
542
552
 
543
553
  /** Known values of {@link AofFrequency} that the service accepts. */
544
554
  export declare enum KnownAofFrequency {
555
+ /** OneS */
545
556
  OneS = "1s",
557
+ /** Always */
546
558
  Always = "always"
547
559
  }
548
560
 
549
561
  /** Known values of {@link ClusteringPolicy} that the service accepts. */
550
562
  export declare enum KnownClusteringPolicy {
563
+ /** EnterpriseCluster */
551
564
  EnterpriseCluster = "EnterpriseCluster",
565
+ /** OSSCluster */
552
566
  OSSCluster = "OSSCluster"
553
567
  }
554
568
 
555
569
  /** Known values of {@link EvictionPolicy} that the service accepts. */
556
570
  export declare enum KnownEvictionPolicy {
571
+ /** AllKeysLFU */
557
572
  AllKeysLFU = "AllKeysLFU",
573
+ /** AllKeysLRU */
558
574
  AllKeysLRU = "AllKeysLRU",
575
+ /** AllKeysRandom */
559
576
  AllKeysRandom = "AllKeysRandom",
577
+ /** VolatileLRU */
560
578
  VolatileLRU = "VolatileLRU",
579
+ /** VolatileLFU */
561
580
  VolatileLFU = "VolatileLFU",
581
+ /** VolatileTTL */
562
582
  VolatileTTL = "VolatileTTL",
583
+ /** VolatileRandom */
563
584
  VolatileRandom = "VolatileRandom",
585
+ /** NoEviction */
564
586
  NoEviction = "NoEviction"
565
587
  }
566
588
 
567
589
  /** Known values of {@link LinkState} that the service accepts. */
568
590
  export declare enum KnownLinkState {
591
+ /** Linked */
569
592
  Linked = "Linked",
593
+ /** Linking */
570
594
  Linking = "Linking",
595
+ /** Unlinking */
571
596
  Unlinking = "Unlinking",
597
+ /** LinkFailed */
572
598
  LinkFailed = "LinkFailed",
599
+ /** UnlinkFailed */
573
600
  UnlinkFailed = "UnlinkFailed"
574
601
  }
575
602
 
576
603
  /** Known values of {@link Origin} that the service accepts. */
577
604
  export declare enum KnownOrigin {
605
+ /** User */
578
606
  User = "user",
607
+ /** System */
579
608
  System = "system",
609
+ /** UserSystem */
580
610
  UserSystem = "user,system"
581
611
  }
582
612
 
583
613
  /** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */
584
614
  export declare enum KnownPrivateEndpointConnectionProvisioningState {
615
+ /** Succeeded */
585
616
  Succeeded = "Succeeded",
617
+ /** Creating */
586
618
  Creating = "Creating",
619
+ /** Deleting */
587
620
  Deleting = "Deleting",
621
+ /** Failed */
588
622
  Failed = "Failed"
589
623
  }
590
624
 
591
625
  /** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */
592
626
  export declare enum KnownPrivateEndpointServiceConnectionStatus {
627
+ /** Pending */
593
628
  Pending = "Pending",
629
+ /** Approved */
594
630
  Approved = "Approved",
631
+ /** Rejected */
595
632
  Rejected = "Rejected"
596
633
  }
597
634
 
598
635
  /** Known values of {@link Protocol} that the service accepts. */
599
636
  export declare enum KnownProtocol {
637
+ /** Encrypted */
600
638
  Encrypted = "Encrypted",
639
+ /** Plaintext */
601
640
  Plaintext = "Plaintext"
602
641
  }
603
642
 
604
643
  /** Known values of {@link ProvisioningState} that the service accepts. */
605
644
  export declare enum KnownProvisioningState {
645
+ /** Succeeded */
606
646
  Succeeded = "Succeeded",
647
+ /** Failed */
607
648
  Failed = "Failed",
649
+ /** Canceled */
608
650
  Canceled = "Canceled",
651
+ /** Creating */
609
652
  Creating = "Creating",
653
+ /** Updating */
610
654
  Updating = "Updating",
655
+ /** Deleting */
611
656
  Deleting = "Deleting"
612
657
  }
613
658
 
614
659
  /** Known values of {@link RdbFrequency} that the service accepts. */
615
660
  export declare enum KnownRdbFrequency {
661
+ /** OneH */
616
662
  OneH = "1h",
663
+ /** SixH */
617
664
  SixH = "6h",
665
+ /** TwelveH */
618
666
  TwelveH = "12h"
619
667
  }
620
668
 
621
669
  /** Known values of {@link ResourceState} that the service accepts. */
622
670
  export declare enum KnownResourceState {
671
+ /** Running */
623
672
  Running = "Running",
673
+ /** Creating */
624
674
  Creating = "Creating",
675
+ /** CreateFailed */
625
676
  CreateFailed = "CreateFailed",
677
+ /** Updating */
626
678
  Updating = "Updating",
679
+ /** UpdateFailed */
627
680
  UpdateFailed = "UpdateFailed",
681
+ /** Deleting */
628
682
  Deleting = "Deleting",
683
+ /** DeleteFailed */
629
684
  DeleteFailed = "DeleteFailed",
685
+ /** Enabling */
630
686
  Enabling = "Enabling",
687
+ /** EnableFailed */
631
688
  EnableFailed = "EnableFailed",
689
+ /** Disabling */
632
690
  Disabling = "Disabling",
691
+ /** DisableFailed */
633
692
  DisableFailed = "DisableFailed",
693
+ /** Disabled */
634
694
  Disabled = "Disabled"
635
695
  }
636
696
 
637
697
  /** Known values of {@link SkuName} that the service accepts. */
638
698
  export declare enum KnownSkuName {
699
+ /** EnterpriseE10 */
639
700
  EnterpriseE10 = "Enterprise_E10",
701
+ /** EnterpriseE20 */
640
702
  EnterpriseE20 = "Enterprise_E20",
703
+ /** EnterpriseE50 */
641
704
  EnterpriseE50 = "Enterprise_E50",
705
+ /** EnterpriseE100 */
642
706
  EnterpriseE100 = "Enterprise_E100",
707
+ /** EnterpriseFlashF300 */
643
708
  EnterpriseFlashF300 = "EnterpriseFlash_F300",
709
+ /** EnterpriseFlashF700 */
644
710
  EnterpriseFlashF700 = "EnterpriseFlash_F700",
711
+ /** EnterpriseFlashF1500 */
645
712
  EnterpriseFlashF1500 = "EnterpriseFlash_F1500"
646
713
  }
647
714
 
648
715
  /** Known values of {@link TlsVersion} that the service accepts. */
649
716
  export declare enum KnownTlsVersion {
717
+ /** One0 */
650
718
  One0 = "1.0",
719
+ /** One1 */
651
720
  One1 = "1.1",
721
+ /** One2 */
652
722
  One2 = "1.2"
653
723
  }
654
724
 
@@ -780,8 +850,8 @@ export declare type OperationsListResponse = OperationListResult;
780
850
  export declare interface OperationsStatus {
781
851
  /**
782
852
  * Gets the status of operation.
783
- * @param location The region the operation is in.
784
- * @param operationId The operation's unique identifier.
853
+ * @param location The name of Azure region.
854
+ * @param operationId The ID of an ongoing async operation.
785
855
  * @param options The options parameters.
786
856
  */
787
857
  get(location: string, operationId: string, options?: OperationsStatusGetOptionalParams): Promise<OperationsStatusGetResponse>;
@@ -843,7 +913,7 @@ export declare interface PrivateEndpoint {
843
913
  }
844
914
 
845
915
  /** The Private Endpoint Connection resource. */
846
- export declare type PrivateEndpointConnection = Resource & {
916
+ export declare interface PrivateEndpointConnection extends Resource {
847
917
  /** The resource of private end point. */
848
918
  privateEndpoint?: PrivateEndpoint;
849
919
  /** A collection of information about the state of the connection between service consumer and provider. */
@@ -853,7 +923,7 @@ export declare type PrivateEndpointConnection = Resource & {
853
923
  * NOTE: This property will not be serialized. It can only be populated by the server.
854
924
  */
855
925
  readonly provisioningState?: PrivateEndpointConnectionProvisioningState;
856
- };
926
+ }
857
927
 
858
928
  /** List of private endpoint connection associated with the specified storage account */
859
929
  export declare interface PrivateEndpointConnectionListResult {
@@ -965,7 +1035,7 @@ export declare type PrivateEndpointConnectionsPutResponse = PrivateEndpointConne
965
1035
  export declare type PrivateEndpointServiceConnectionStatus = string;
966
1036
 
967
1037
  /** A private link resource */
968
- export declare type PrivateLinkResource = Resource & {
1038
+ export declare interface PrivateLinkResource extends Resource {
969
1039
  /**
970
1040
  * The private link resource group id.
971
1041
  * NOTE: This property will not be serialized. It can only be populated by the server.
@@ -978,7 +1048,7 @@ export declare type PrivateLinkResource = Resource & {
978
1048
  readonly requiredMembers?: string[];
979
1049
  /** The private link resource Private link DNS zone name. */
980
1050
  requiredZoneNames?: string[];
981
- };
1051
+ }
982
1052
 
983
1053
  /** A list of private link resources */
984
1054
  export declare interface PrivateLinkResourceListResult {
@@ -1039,7 +1109,8 @@ export declare type Protocol = string;
1039
1109
  export declare type ProvisioningState = string;
1040
1110
 
1041
1111
  /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */
1042
- export declare type ProxyResource = Resource & {};
1112
+ export declare interface ProxyResource extends Resource {
1113
+ }
1043
1114
 
1044
1115
  /**
1045
1116
  * Defines values for RdbFrequency. \
@@ -1185,6 +1256,8 @@ export declare class RedisEnterpriseManagementClient extends coreClient.ServiceC
1185
1256
  * @param options The parameter options
1186
1257
  */
1187
1258
  constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: RedisEnterpriseManagementClientOptionalParams);
1259
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
1260
+ private addCustomApiVersionPolicy;
1188
1261
  operations: Operations;
1189
1262
  operationsStatus: OperationsStatus;
1190
1263
  redisEnterprise: RedisEnterprise;
@@ -1294,13 +1367,13 @@ export declare type SkuName = string;
1294
1367
  export declare type TlsVersion = string;
1295
1368
 
1296
1369
  /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */
1297
- export declare type TrackedResource = Resource & {
1370
+ export declare interface TrackedResource extends Resource {
1298
1371
  /** Resource tags. */
1299
1372
  tags?: {
1300
1373
  [propertyName: string]: string;
1301
1374
  };
1302
1375
  /** The geo-location where the resource lives */
1303
1376
  location: string;
1304
- };
1377
+ }
1305
1378
 
1306
1379
  export { }