@azure/arm-servicefabric 2.0.2-alpha.20221213.2 → 2.1.0

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 (44) hide show
  1. package/CHANGELOG.md +22 -10
  2. package/dist/index.js +152 -38
  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 +83 -37
  11. package/dist-esm/src/models/index.d.ts.map +1 -1
  12. package/dist-esm/src/models/index.js +38 -0
  13. package/dist-esm/src/models/index.js.map +1 -1
  14. package/dist-esm/src/models/mappers.d.ts +5 -3
  15. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  16. package/dist-esm/src/models/mappers.js +14 -11
  17. package/dist-esm/src/models/mappers.js.map +1 -1
  18. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  19. package/dist-esm/src/operations/operations.js +19 -8
  20. package/dist-esm/src/operations/operations.js.map +1 -1
  21. package/dist-esm/src/pagingHelper.d.ts +13 -0
  22. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  23. package/dist-esm/src/pagingHelper.js +32 -0
  24. package/dist-esm/src/pagingHelper.js.map +1 -0
  25. package/dist-esm/src/serviceFabricManagementClient.d.ts +2 -0
  26. package/dist-esm/src/serviceFabricManagementClient.d.ts.map +1 -1
  27. package/dist-esm/src/serviceFabricManagementClient.js +49 -18
  28. package/dist-esm/src/serviceFabricManagementClient.js.map +1 -1
  29. package/dist-esm/test/{servicefabric.d.ts → servicefabric_examples.spec.d.ts} +1 -1
  30. package/dist-esm/test/servicefabric_examples.spec.d.ts.map +1 -0
  31. package/dist-esm/test/{servicefabric.js → servicefabric_examples.spec.js} +17 -19
  32. package/dist-esm/test/servicefabric_examples.spec.js.map +1 -0
  33. package/package.json +13 -9
  34. package/review/arm-servicefabric.api.md +84 -115
  35. package/src/index.ts +1 -0
  36. package/src/models/index.ts +91 -37
  37. package/src/models/mappers.ts +14 -11
  38. package/src/operations/operations.ts +21 -9
  39. package/src/pagingHelper.ts +39 -0
  40. package/src/serviceFabricManagementClient.ts +60 -20
  41. package/types/arm-servicefabric.d.ts +94 -37
  42. package/types/tsdoc-metadata.json +1 -1
  43. package/dist-esm/test/servicefabric.d.ts.map +0 -1
  44. package/dist-esm/test/servicefabric.js.map +0 -1
@@ -807,7 +807,7 @@ export interface ServiceLoadMetricDescription {
807
807
  /** Describes the policy to be used for placement of a Service Fabric service. */
808
808
  export interface ServicePlacementPolicyDescription {
809
809
  /** Polymorphic discriminator, which specifies the different types this object can be */
810
- type: "undefined";
810
+ type: "ServicePlacementPolicyDescription";
811
811
  }
812
812
 
813
813
  /** The list of service resources. */
@@ -824,7 +824,7 @@ export interface ServiceResourceList {
824
824
  * The cluster resource
825
825
  *
826
826
  */
827
- export type Cluster = Resource & {
827
+ export interface Cluster extends Resource {
828
828
  /** The list of add-on features to enable in the cluster. */
829
829
  addOnFeatures?: AddOnFeatures[];
830
830
  /**
@@ -925,19 +925,19 @@ export type Cluster = Resource & {
925
925
  waveUpgradePaused?: boolean;
926
926
  /** Indicates a list of notification channels for cluster events. */
927
927
  notifications?: Notification[];
928
- };
928
+ }
929
929
 
930
930
  /** The application type name resource */
931
- export type ApplicationTypeResource = ProxyResource & {
931
+ export interface ApplicationTypeResource extends ProxyResource {
932
932
  /**
933
933
  * The current deployment or provisioning state, which only appears in the response.
934
934
  * NOTE: This property will not be serialized. It can only be populated by the server.
935
935
  */
936
936
  readonly provisioningState?: string;
937
- };
937
+ }
938
938
 
939
939
  /** An application type version resource for the specified application type name resource. */
940
- export type ApplicationTypeVersionResource = ProxyResource & {
940
+ export interface ApplicationTypeVersionResource extends ProxyResource {
941
941
  /**
942
942
  * The current deployment or provisioning state, which only appears in the response
943
943
  * NOTE: This property will not be serialized. It can only be populated by the server.
@@ -950,10 +950,10 @@ export type ApplicationTypeVersionResource = ProxyResource & {
950
950
  * NOTE: This property will not be serialized. It can only be populated by the server.
951
951
  */
952
952
  readonly defaultParameterList?: { [propertyName: string]: string };
953
- };
953
+ }
954
954
 
955
955
  /** The application resource. */
956
- export type ApplicationResource = ProxyResource & {
956
+ export interface ApplicationResource extends ProxyResource {
957
957
  /** Describes the managed identities for an Azure resource. */
958
958
  identity?: ManagedIdentity;
959
959
  /** The version of the application type as defined in the application manifest. */
@@ -979,10 +979,10 @@ export type ApplicationResource = ProxyResource & {
979
979
  readonly provisioningState?: string;
980
980
  /** The application type name as defined in the application manifest. */
981
981
  typeName?: string;
982
- };
982
+ }
983
983
 
984
984
  /** The application resource for patch operations. */
985
- export type ApplicationResourceUpdate = ProxyResource & {
985
+ export interface ApplicationResourceUpdate extends ProxyResource {
986
986
  /** The version of the application type as defined in the application manifest. */
987
987
  typeVersion?: string;
988
988
  /** List of application parameters with overridden values from their default values specified in the application manifest. */
@@ -999,10 +999,10 @@ export type ApplicationResourceUpdate = ProxyResource & {
999
999
  metrics?: ApplicationMetricDescription[];
1000
1000
  /** List of user assigned identities for the application, each mapped to a friendly name. */
1001
1001
  managedIdentities?: ApplicationUserAssignedIdentity[];
1002
- };
1002
+ }
1003
1003
 
1004
1004
  /** The service resource. */
1005
- export type ServiceResource = ProxyResource & {
1005
+ export interface ServiceResource extends ProxyResource {
1006
1006
  /** The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". */
1007
1007
  placementConstraints?: string;
1008
1008
  /** A list that describes the correlation of the service with other services. */
@@ -1028,10 +1028,10 @@ export type ServiceResource = ProxyResource & {
1028
1028
  servicePackageActivationMode?: ArmServicePackageActivationMode;
1029
1029
  /** Dns name used for the service. If this is specified, then the service can be accessed via its DNS name instead of service name. */
1030
1030
  serviceDnsName?: string;
1031
- };
1031
+ }
1032
1032
 
1033
1033
  /** The service resource for patch operations. */
1034
- export type ServiceResourceUpdate = ProxyResource & {
1034
+ export interface ServiceResourceUpdate extends ProxyResource {
1035
1035
  /** The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". */
1036
1036
  placementConstraints?: string;
1037
1037
  /** A list that describes the correlation of the service with other services. */
@@ -1044,10 +1044,11 @@ export type ServiceResourceUpdate = ProxyResource & {
1044
1044
  defaultMoveCost?: MoveCost;
1045
1045
  /** The kind of service (Stateless or Stateful). */
1046
1046
  serviceKind?: ServiceKind;
1047
- };
1047
+ }
1048
1048
 
1049
1049
  /** The application resource properties. */
1050
- export type ApplicationResourceProperties = ApplicationResourceUpdateProperties & {
1050
+ export interface ApplicationResourceProperties
1051
+ extends ApplicationResourceUpdateProperties {
1051
1052
  /**
1052
1053
  * The current deployment or provisioning state, which only appears in the response
1053
1054
  * NOTE: This property will not be serialized. It can only be populated by the server.
@@ -1055,26 +1056,29 @@ export type ApplicationResourceProperties = ApplicationResourceUpdateProperties
1055
1056
  readonly provisioningState?: string;
1056
1057
  /** The application type name as defined in the application manifest. */
1057
1058
  typeName?: string;
1058
- };
1059
+ }
1059
1060
 
1060
1061
  /** Describes the named partition scheme of the service. */
1061
- export type NamedPartitionSchemeDescription = PartitionSchemeDescription & {
1062
+ export interface NamedPartitionSchemeDescription
1063
+ extends PartitionSchemeDescription {
1062
1064
  /** Polymorphic discriminator, which specifies the different types this object can be */
1063
1065
  partitionScheme: "Named";
1064
1066
  /** The number of partitions. */
1065
1067
  count: number;
1066
1068
  /** Array of size specified by the ‘count’ parameter, for the names of the partitions. */
1067
1069
  names: string[];
1068
- };
1070
+ }
1069
1071
 
1070
1072
  /** SingletonPartitionSchemeDescription */
1071
- export type SingletonPartitionSchemeDescription = PartitionSchemeDescription & {
1073
+ export interface SingletonPartitionSchemeDescription
1074
+ extends PartitionSchemeDescription {
1072
1075
  /** Polymorphic discriminator, which specifies the different types this object can be */
1073
1076
  partitionScheme: "Singleton";
1074
- };
1077
+ }
1075
1078
 
1076
1079
  /** Describes a partitioning scheme where an integer range is allocated evenly across a number of partitions. */
1077
- export type UniformInt64RangePartitionSchemeDescription = PartitionSchemeDescription & {
1080
+ export interface UniformInt64RangePartitionSchemeDescription
1081
+ extends PartitionSchemeDescription {
1078
1082
  /** Polymorphic discriminator, which specifies the different types this object can be */
1079
1083
  partitionScheme: "UniformInt64Range";
1080
1084
  /** The number of partitions. */
@@ -1091,10 +1095,11 @@ export type UniformInt64RangePartitionSchemeDescription = PartitionSchemeDescrip
1091
1095
  *
1092
1096
  */
1093
1097
  highKey: string;
1094
- };
1098
+ }
1095
1099
 
1096
1100
  /** The service resource properties. */
1097
- export type ServiceResourceProperties = ServiceResourcePropertiesBase & {
1101
+ export interface ServiceResourceProperties
1102
+ extends ServiceResourcePropertiesBase {
1098
1103
  /**
1099
1104
  * The current deployment or provisioning state, which only appears in the response
1100
1105
  * NOTE: This property will not be serialized. It can only be populated by the server.
@@ -1110,16 +1115,19 @@ export type ServiceResourceProperties = ServiceResourcePropertiesBase & {
1110
1115
  servicePackageActivationMode?: ArmServicePackageActivationMode;
1111
1116
  /** Dns name used for the service. If this is specified, then the service can be accessed via its DNS name instead of service name. */
1112
1117
  serviceDnsName?: string;
1113
- };
1118
+ }
1114
1119
 
1115
1120
  /** The service resource properties for patch operations. */
1116
- export type ServiceResourceUpdateProperties = ServiceResourcePropertiesBase & {
1121
+ export interface ServiceResourceUpdateProperties
1122
+ extends ServiceResourcePropertiesBase {
1117
1123
  /** The kind of service (Stateless or Stateful). */
1118
1124
  serviceKind: ServiceKind;
1119
- };
1125
+ }
1120
1126
 
1121
1127
  /** The properties of a stateful service resource. */
1122
- export type StatefulServiceProperties = ServiceResourceProperties & {
1128
+ export interface StatefulServiceProperties extends ServiceResourceProperties {
1129
+ /** Polymorphic discriminator, which specifies the different types this object can be */
1130
+ serviceKind: "Stateful";
1123
1131
  /** A flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. */
1124
1132
  hasPersistedState?: boolean;
1125
1133
  /** The target replica set size as a number. */
@@ -1132,18 +1140,23 @@ export type StatefulServiceProperties = ServiceResourceProperties & {
1132
1140
  quorumLossWaitDuration?: Date;
1133
1141
  /** The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format (hh:mm:ss.s). */
1134
1142
  standByReplicaKeepDuration?: Date;
1135
- };
1143
+ }
1136
1144
 
1137
1145
  /** The properties of a stateless service resource. */
1138
- export type StatelessServiceProperties = ServiceResourceProperties & {
1146
+ export interface StatelessServiceProperties extends ServiceResourceProperties {
1147
+ /** Polymorphic discriminator, which specifies the different types this object can be */
1148
+ serviceKind: "Stateless";
1139
1149
  /** The instance count. */
1140
1150
  instanceCount?: number;
1141
- /** Delay duration for RequestDrain feature to ensures that the endpoint advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay enables existing requests to drain gracefully before the instance actually goes down (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. */
1151
+ /** Delay duration for RequestDrain feature to ensures that the endpoint advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay enables existing requests to drain gracefully before the instance actually goes down (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). It is represented in ISO 8601 format (hh:mm:ss.s). */
1142
1152
  instanceCloseDelayDuration?: string;
1143
- };
1153
+ }
1144
1154
 
1145
1155
  /** The properties of a stateful service resource for patch operations. */
1146
- export type StatefulServiceUpdateProperties = ServiceResourceUpdateProperties & {
1156
+ export interface StatefulServiceUpdateProperties
1157
+ extends ServiceResourceUpdateProperties {
1158
+ /** Polymorphic discriminator, which specifies the different types this object can be */
1159
+ serviceKind: "Stateful";
1147
1160
  /** The target replica set size as a number. */
1148
1161
  targetReplicaSetSize?: number;
1149
1162
  /** The minimum replica set size as a number. */
@@ -1154,21 +1167,28 @@ export type StatefulServiceUpdateProperties = ServiceResourceUpdateProperties &
1154
1167
  quorumLossWaitDuration?: Date;
1155
1168
  /** The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format (hh:mm:ss.s). */
1156
1169
  standByReplicaKeepDuration?: Date;
1157
- };
1170
+ }
1158
1171
 
1159
1172
  /** The properties of a stateless service resource for patch operations. */
1160
- export type StatelessServiceUpdateProperties = ServiceResourceUpdateProperties & {
1173
+ export interface StatelessServiceUpdateProperties
1174
+ extends ServiceResourceUpdateProperties {
1175
+ /** Polymorphic discriminator, which specifies the different types this object can be */
1176
+ serviceKind: "Stateless";
1161
1177
  /** The instance count. */
1162
1178
  instanceCount?: number;
1163
- /** Delay duration for RequestDrain feature to ensures that the endpoint advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay enables existing requests to drain gracefully before the instance actually goes down (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. */
1179
+ /** Delay duration for RequestDrain feature to ensures that the endpoint advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay enables existing requests to drain gracefully before the instance actually goes down (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). It is first interpreted as a string representing an ISO 8601 duration. It is represented in ISO 8601 format (hh:mm:ss.s). */
1164
1180
  instanceCloseDelayDuration?: string;
1165
- };
1181
+ }
1166
1182
 
1167
1183
  /** Known values of {@link AddOnFeatures} that the service accepts. */
1168
1184
  export enum KnownAddOnFeatures {
1185
+ /** RepairManager */
1169
1186
  RepairManager = "RepairManager",
1187
+ /** DnsService */
1170
1188
  DnsService = "DnsService",
1189
+ /** BackupRestoreService */
1171
1190
  BackupRestoreService = "BackupRestoreService",
1191
+ /** ResourceMonitorService */
1172
1192
  ResourceMonitorService = "ResourceMonitorService"
1173
1193
  }
1174
1194
 
@@ -1186,7 +1206,9 @@ export type AddOnFeatures = string;
1186
1206
 
1187
1207
  /** Known values of {@link ClusterEnvironment} that the service accepts. */
1188
1208
  export enum KnownClusterEnvironment {
1209
+ /** Windows */
1189
1210
  Windows = "Windows",
1211
+ /** Linux */
1190
1212
  Linux = "Linux"
1191
1213
  }
1192
1214
 
@@ -1202,13 +1224,21 @@ export type ClusterEnvironment = string;
1202
1224
 
1203
1225
  /** Known values of {@link StoreName} that the service accepts. */
1204
1226
  export enum KnownStoreName {
1227
+ /** AddressBook */
1205
1228
  AddressBook = "AddressBook",
1229
+ /** AuthRoot */
1206
1230
  AuthRoot = "AuthRoot",
1231
+ /** CertificateAuthority */
1207
1232
  CertificateAuthority = "CertificateAuthority",
1233
+ /** Disallowed */
1208
1234
  Disallowed = "Disallowed",
1235
+ /** My */
1209
1236
  My = "My",
1237
+ /** Root */
1210
1238
  Root = "Root",
1239
+ /** TrustedPeople */
1211
1240
  TrustedPeople = "TrustedPeople",
1241
+ /** TrustedPublisher */
1212
1242
  TrustedPublisher = "TrustedPublisher"
1213
1243
  }
1214
1244
 
@@ -1230,15 +1260,25 @@ export type StoreName = string;
1230
1260
 
1231
1261
  /** Known values of {@link ClusterState} that the service accepts. */
1232
1262
  export enum KnownClusterState {
1263
+ /** WaitingForNodes */
1233
1264
  WaitingForNodes = "WaitingForNodes",
1265
+ /** Deploying */
1234
1266
  Deploying = "Deploying",
1267
+ /** BaselineUpgrade */
1235
1268
  BaselineUpgrade = "BaselineUpgrade",
1269
+ /** UpdatingUserConfiguration */
1236
1270
  UpdatingUserConfiguration = "UpdatingUserConfiguration",
1271
+ /** UpdatingUserCertificate */
1237
1272
  UpdatingUserCertificate = "UpdatingUserCertificate",
1273
+ /** UpdatingInfrastructure */
1238
1274
  UpdatingInfrastructure = "UpdatingInfrastructure",
1275
+ /** EnforcingClusterVersion */
1239
1276
  EnforcingClusterVersion = "EnforcingClusterVersion",
1277
+ /** UpgradeServiceUnreachable */
1240
1278
  UpgradeServiceUnreachable = "UpgradeServiceUnreachable",
1279
+ /** AutoScale */
1241
1280
  AutoScale = "AutoScale",
1281
+ /** Ready */
1242
1282
  Ready = "Ready"
1243
1283
  }
1244
1284
 
@@ -1262,8 +1302,11 @@ export type ClusterState = string;
1262
1302
 
1263
1303
  /** Known values of {@link DurabilityLevel} that the service accepts. */
1264
1304
  export enum KnownDurabilityLevel {
1305
+ /** Bronze */
1265
1306
  Bronze = "Bronze",
1307
+ /** Silver */
1266
1308
  Silver = "Silver",
1309
+ /** Gold */
1267
1310
  Gold = "Gold"
1268
1311
  }
1269
1312
 
@@ -1280,9 +1323,13 @@ export type DurabilityLevel = string;
1280
1323
 
1281
1324
  /** Known values of {@link ProvisioningState} that the service accepts. */
1282
1325
  export enum KnownProvisioningState {
1326
+ /** Updating */
1283
1327
  Updating = "Updating",
1328
+ /** Succeeded */
1284
1329
  Succeeded = "Succeeded",
1330
+ /** Failed */
1285
1331
  Failed = "Failed",
1332
+ /** Canceled */
1286
1333
  Canceled = "Canceled"
1287
1334
  }
1288
1335
 
@@ -1300,10 +1347,15 @@ export type ProvisioningState = string;
1300
1347
 
1301
1348
  /** Known values of {@link ReliabilityLevel} that the service accepts. */
1302
1349
  export enum KnownReliabilityLevel {
1350
+ /** None */
1303
1351
  None = "None",
1352
+ /** Bronze */
1304
1353
  Bronze = "Bronze",
1354
+ /** Silver */
1305
1355
  Silver = "Silver",
1356
+ /** Gold */
1306
1357
  Gold = "Gold",
1358
+ /** Platinum */
1307
1359
  Platinum = "Platinum"
1308
1360
  }
1309
1361
 
@@ -1448,7 +1500,9 @@ export type NotificationChannel = string;
1448
1500
 
1449
1501
  /** Known values of {@link Enum14} that the service accepts. */
1450
1502
  export enum KnownEnum14 {
1503
+ /** Windows */
1451
1504
  Windows = "Windows",
1505
+ /** Linux */
1452
1506
  Linux = "Linux"
1453
1507
  }
1454
1508
 
@@ -1995,6 +1995,7 @@ export const ServiceLoadMetricDescription: coreClient.CompositeMapper = {
1995
1995
  };
1996
1996
 
1997
1997
  export const ServicePlacementPolicyDescription: coreClient.CompositeMapper = {
1998
+ serializedName: "ServicePlacementPolicyDescription",
1998
1999
  type: {
1999
2000
  name: "Composite",
2000
2001
  className: "ServicePlacementPolicyDescription",
@@ -2874,9 +2875,9 @@ export const StatefulServiceProperties: coreClient.CompositeMapper = {
2874
2875
  type: {
2875
2876
  name: "Composite",
2876
2877
  className: "StatefulServiceProperties",
2877
- uberParent: "ServiceResourcePropertiesBase",
2878
+ uberParent: "ServiceResourceProperties",
2878
2879
  polymorphicDiscriminator:
2879
- ServiceResourcePropertiesBase.type.polymorphicDiscriminator,
2880
+ ServiceResourceProperties.type.polymorphicDiscriminator,
2880
2881
  modelProperties: {
2881
2882
  ...ServiceResourceProperties.type.modelProperties,
2882
2883
  hasPersistedState: {
@@ -2930,9 +2931,9 @@ export const StatelessServiceProperties: coreClient.CompositeMapper = {
2930
2931
  type: {
2931
2932
  name: "Composite",
2932
2933
  className: "StatelessServiceProperties",
2933
- uberParent: "ServiceResourcePropertiesBase",
2934
+ uberParent: "ServiceResourceProperties",
2934
2935
  polymorphicDiscriminator:
2935
- ServiceResourcePropertiesBase.type.polymorphicDiscriminator,
2936
+ ServiceResourceProperties.type.polymorphicDiscriminator,
2936
2937
  modelProperties: {
2937
2938
  ...ServiceResourceProperties.type.modelProperties,
2938
2939
  instanceCount: {
@@ -2959,9 +2960,9 @@ export const StatefulServiceUpdateProperties: coreClient.CompositeMapper = {
2959
2960
  type: {
2960
2961
  name: "Composite",
2961
2962
  className: "StatefulServiceUpdateProperties",
2962
- uberParent: "ServiceResourcePropertiesBase",
2963
+ uberParent: "ServiceResourceUpdateProperties",
2963
2964
  polymorphicDiscriminator:
2964
- ServiceResourcePropertiesBase.type.polymorphicDiscriminator,
2965
+ ServiceResourceUpdateProperties.type.polymorphicDiscriminator,
2965
2966
  modelProperties: {
2966
2967
  ...ServiceResourceUpdateProperties.type.modelProperties,
2967
2968
  targetReplicaSetSize: {
@@ -3009,9 +3010,9 @@ export const StatelessServiceUpdateProperties: coreClient.CompositeMapper = {
3009
3010
  type: {
3010
3011
  name: "Composite",
3011
3012
  className: "StatelessServiceUpdateProperties",
3012
- uberParent: "ServiceResourcePropertiesBase",
3013
+ uberParent: "ServiceResourceUpdateProperties",
3013
3014
  polymorphicDiscriminator:
3014
- ServiceResourcePropertiesBase.type.polymorphicDiscriminator,
3015
+ ServiceResourceUpdateProperties.type.polymorphicDiscriminator,
3015
3016
  modelProperties: {
3016
3017
  ...ServiceResourceUpdateProperties.type.modelProperties,
3017
3018
  instanceCount: {
@@ -3035,12 +3036,14 @@ export const StatelessServiceUpdateProperties: coreClient.CompositeMapper = {
3035
3036
 
3036
3037
  export let discriminators = {
3037
3038
  PartitionSchemeDescription: PartitionSchemeDescription,
3038
- "ServicePlacementPolicyDescription.undefined": ServicePlacementPolicyDescription,
3039
+ "ServicePlacementPolicyDescription.ServicePlacementPolicyDescription": ServicePlacementPolicyDescription,
3039
3040
  "PartitionSchemeDescription.Named": NamedPartitionSchemeDescription,
3040
3041
  "PartitionSchemeDescription.Singleton": SingletonPartitionSchemeDescription,
3041
3042
  "PartitionSchemeDescription.UniformInt64Range": UniformInt64RangePartitionSchemeDescription,
3042
3043
  "ServiceResourcePropertiesBase.ServiceResourceProperties": ServiceResourceProperties,
3043
3044
  "ServiceResourcePropertiesBase.ServiceResourceUpdateProperties": ServiceResourceUpdateProperties,
3044
- "ServiceResourcePropertiesBase.Stateful": StatefulServiceUpdateProperties,
3045
- "ServiceResourcePropertiesBase.Stateless": StatelessServiceUpdateProperties
3045
+ "ServiceResourceProperties.Stateful": StatefulServiceProperties,
3046
+ "ServiceResourceProperties.Stateless": StatelessServiceProperties,
3047
+ "ServiceResourceUpdateProperties.Stateful": StatefulServiceUpdateProperties,
3048
+ "ServiceResourceUpdateProperties.Stateless": StatelessServiceUpdateProperties
3046
3049
  };
@@ -6,7 +6,8 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- import { PagedAsyncIterableIterator } from "@azure/core-paging";
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
10
11
  import { Operations } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -48,22 +49,34 @@ export class OperationsImpl implements Operations {
48
49
  [Symbol.asyncIterator]() {
49
50
  return this;
50
51
  },
51
- byPage: () => {
52
- return this.listPagingPage(options);
52
+ byPage: (settings?: PageSettings) => {
53
+ if (settings?.maxPageSize) {
54
+ throw new Error("maxPageSize is not supported by this operation.");
55
+ }
56
+ return this.listPagingPage(options, settings);
53
57
  }
54
58
  };
55
59
  }
56
60
 
57
61
  private async *listPagingPage(
58
- options?: OperationsListOptionalParams
62
+ options?: OperationsListOptionalParams,
63
+ settings?: PageSettings
59
64
  ): AsyncIterableIterator<OperationResult[]> {
60
- let result = await this._list(options);
61
- yield result.value || [];
62
- let continuationToken = result.nextLink;
65
+ let result: OperationsListResponse;
66
+ let continuationToken = settings?.continuationToken;
67
+ if (!continuationToken) {
68
+ result = await this._list(options);
69
+ let page = result.value || [];
70
+ continuationToken = result.nextLink;
71
+ setContinuationToken(page, continuationToken);
72
+ yield page;
73
+ }
63
74
  while (continuationToken) {
64
75
  result = await this._listNext(continuationToken, options);
65
76
  continuationToken = result.nextLink;
66
- yield result.value || [];
77
+ let page = result.value || [];
78
+ setContinuationToken(page, continuationToken);
79
+ yield page;
67
80
  }
68
81
  }
69
82
 
@@ -130,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
130
143
  bodyMapper: Mappers.ErrorModel
131
144
  }
132
145
  },
133
- queryParameters: [Parameters.apiVersion],
134
146
  urlParameters: [Parameters.$host, Parameters.nextLink],
135
147
  headerParameters: [Parameters.accept],
136
148
  serializer
@@ -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
+ }
@@ -8,6 +8,11 @@
8
8
 
9
9
  import * as coreClient from "@azure/core-client";
10
10
  import * as coreRestPipeline from "@azure/core-rest-pipeline";
11
+ import {
12
+ PipelineRequest,
13
+ PipelineResponse,
14
+ SendRequest
15
+ } from "@azure/core-rest-pipeline";
11
16
  import * as coreAuth from "@azure/core-auth";
12
17
  import {
13
18
  ClustersImpl,
@@ -61,47 +66,53 @@ export class ServiceFabricManagementClient extends coreClient.ServiceClient {
61
66
  credential: credentials
62
67
  };
63
68
 
64
- const packageDetails = `azsdk-js-arm-servicefabric/2.0.2`;
69
+ const packageDetails = `azsdk-js-arm-servicefabric/2.1.0`;
65
70
  const userAgentPrefix =
66
71
  options.userAgentOptions && options.userAgentOptions.userAgentPrefix
67
72
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
68
73
  : `${packageDetails}`;
69
74
 
70
- if (!options.credentialScopes) {
71
- options.credentialScopes = ["https://management.azure.com/.default"];
72
- }
73
75
  const optionsWithDefaults = {
74
76
  ...defaults,
75
77
  ...options,
76
78
  userAgentOptions: {
77
79
  userAgentPrefix
78
80
  },
79
- baseUri:
81
+ endpoint:
80
82
  options.endpoint ?? options.baseUri ?? "https://management.azure.com"
81
83
  };
82
84
  super(optionsWithDefaults);
83
85
 
86
+ let bearerTokenAuthenticationPolicyFound: boolean = false;
84
87
  if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
85
88
  const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
86
- const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
89
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
87
90
  (pipelinePolicy) =>
88
91
  pipelinePolicy.name ===
89
92
  coreRestPipeline.bearerTokenAuthenticationPolicyName
90
93
  );
91
- if (!bearerTokenAuthenticationPolicyFound) {
92
- this.pipeline.removePolicy({
93
- name: coreRestPipeline.bearerTokenAuthenticationPolicyName
94
- });
95
- this.pipeline.addPolicy(
96
- coreRestPipeline.bearerTokenAuthenticationPolicy({
97
- scopes: `${optionsWithDefaults.baseUri}/.default`,
98
- challengeCallbacks: {
99
- authorizeRequestOnChallenge:
100
- coreClient.authorizeRequestOnClaimChallenge
101
- }
102
- })
103
- );
104
- }
94
+ }
95
+ if (
96
+ !options ||
97
+ !options.pipeline ||
98
+ options.pipeline.getOrderedPolicies().length == 0 ||
99
+ !bearerTokenAuthenticationPolicyFound
100
+ ) {
101
+ this.pipeline.removePolicy({
102
+ name: coreRestPipeline.bearerTokenAuthenticationPolicyName
103
+ });
104
+ this.pipeline.addPolicy(
105
+ coreRestPipeline.bearerTokenAuthenticationPolicy({
106
+ credential: credentials,
107
+ scopes:
108
+ optionsWithDefaults.credentialScopes ??
109
+ `${optionsWithDefaults.endpoint}/.default`,
110
+ challengeCallbacks: {
111
+ authorizeRequestOnChallenge:
112
+ coreClient.authorizeRequestOnClaimChallenge
113
+ }
114
+ })
115
+ );
105
116
  }
106
117
  // Parameter assignments
107
118
  this.subscriptionId = subscriptionId;
@@ -116,6 +127,35 @@ export class ServiceFabricManagementClient extends coreClient.ServiceClient {
116
127
  this.applicationTypeVersions = new ApplicationTypeVersionsImpl(this);
117
128
  this.applications = new ApplicationsImpl(this);
118
129
  this.services = new ServicesImpl(this);
130
+ this.addCustomApiVersionPolicy(options.apiVersion);
131
+ }
132
+
133
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
134
+ private addCustomApiVersionPolicy(apiVersion?: string) {
135
+ if (!apiVersion) {
136
+ return;
137
+ }
138
+ const apiVersionPolicy = {
139
+ name: "CustomApiVersionPolicy",
140
+ async sendRequest(
141
+ request: PipelineRequest,
142
+ next: SendRequest
143
+ ): Promise<PipelineResponse> {
144
+ const param = request.url.split("?");
145
+ if (param.length > 1) {
146
+ const newParams = param[1].split("&").map((item) => {
147
+ if (item.indexOf("api-version") > -1) {
148
+ return "api-version=" + apiVersion;
149
+ } else {
150
+ return item;
151
+ }
152
+ });
153
+ request.url = param[0] + "?" + newParams.join("&");
154
+ }
155
+ return next(request);
156
+ }
157
+ };
158
+ this.pipeline.addPolicy(apiVersionPolicy);
119
159
  }
120
160
 
121
161
  clusters: Clusters;