diff --git a/packages/@azure/arm-apimanagement/lib/models/apiIssueMappers.ts b/packages/@azure/arm-apimanagement/lib/models/apiIssueMappers.ts index 9c224b72def4..91cfb111ff00 100644 --- a/packages/@azure/arm-apimanagement/lib/models/apiIssueMappers.ts +++ b/packages/@azure/arm-apimanagement/lib/models/apiIssueMappers.ts @@ -17,6 +17,7 @@ export { ErrorFieldContract, ApiIssueGetEntityTagHeaders, ApiIssueGetHeaders, + IssueUpdateContract, PolicyContract, ApiContract, AuthenticationSettingsContract, diff --git a/packages/@azure/arm-apimanagement/lib/models/index.ts b/packages/@azure/arm-apimanagement/lib/models/index.ts index 80a61ab8f037..6f1d195c191a 100644 --- a/packages/@azure/arm-apimanagement/lib/models/index.ts +++ b/packages/@azure/arm-apimanagement/lib/models/index.ts @@ -1161,6 +1161,20 @@ export interface SchemaContract extends Resource { * @extends Resource */ export interface IssueContract extends Resource { + /** + * @member {Date} [createdDate] Date and time when the issue was created. + */ + createdDate?: Date; + /** + * @member {State} [state] Status of the issue. Possible values include: + * 'proposed', 'open', 'removed', 'resolved', 'closed' + */ + state?: State; + /** + * @member {string} [apiId] A resource identifier for the API the issue was + * created for. + */ + apiId?: string; /** * @member {string} title The issue title. */ @@ -1169,6 +1183,20 @@ export interface IssueContract extends Resource { * @member {string} description Text describing the issue. */ description: string; + /** + * @member {string} userId A resource identifier for the user created the + * issue. + */ + userId: string; +} + +/** + * @interface + * An interface representing IssueUpdateContract. + * Issue update Parameters. + * + */ +export interface IssueUpdateContract { /** * @member {Date} [createdDate] Date and time when the issue was created. */ @@ -1179,10 +1207,41 @@ export interface IssueContract extends Resource { */ state?: State; /** - * @member {string} userId A resource identifier for the user created the + * @member {string} [apiId] A resource identifier for the API the issue was + * created for. + */ + apiId?: string; + /** + * @member {string} [title] The issue title. + */ + title?: string; + /** + * @member {string} [description] Text describing the issue. + */ + description?: string; + /** + * @member {string} [userId] A resource identifier for the user created the * issue. */ - userId: string; + userId?: string; +} + +/** + * @interface + * An interface representing IssueContractBaseProperties. + * Issue contract Base Properties. + * + */ +export interface IssueContractBaseProperties { + /** + * @member {Date} [createdDate] Date and time when the issue was created. + */ + createdDate?: Date; + /** + * @member {State} [state] Status of the issue. Possible values include: + * 'proposed', 'open', 'removed', 'resolved', 'closed' + */ + state?: State; /** * @member {string} [apiId] A resource identifier for the API the issue was * created for. @@ -5567,6 +5626,22 @@ export interface ApiIssueCreateOrUpdateOptionalParams extends msRest.RequestOpti ifMatch?: string; } +/** + * @interface + * An interface representing ApiIssueUpdateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface ApiIssueUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [ifMatch] ETag of the Issue Entity. ETag should match the + * current entity state from the header response of the GET request or it + * should be * for unconditional update. + */ + ifMatch?: string; +} + /** * @interface * An interface representing ApiIssueCommentListByServiceOptionalParams. diff --git a/packages/@azure/arm-apimanagement/lib/models/mappers.ts b/packages/@azure/arm-apimanagement/lib/models/mappers.ts index 0125a1000120..0454c9139c32 100644 --- a/packages/@azure/arm-apimanagement/lib/models/mappers.ts +++ b/packages/@azure/arm-apimanagement/lib/models/mappers.ts @@ -1680,6 +1680,24 @@ export const IssueContract: msRest.CompositeMapper = { className: "IssueContract", modelProperties: { ...Resource.type.modelProperties, + createdDate: { + serializedName: "properties.createdDate", + type: { + name: "DateTime" + } + }, + state: { + serializedName: "properties.state", + type: { + name: "String" + } + }, + apiId: { + serializedName: "properties.apiId", + type: { + name: "String" + } + }, title: { required: true, serializedName: "properties.title", @@ -1694,6 +1712,23 @@ export const IssueContract: msRest.CompositeMapper = { name: "String" } }, + userId: { + required: true, + serializedName: "properties.userId", + type: { + name: "String" + } + } + } + } +}; + +export const IssueUpdateContract: msRest.CompositeMapper = { + serializedName: "IssueUpdateContract", + type: { + name: "Composite", + className: "IssueUpdateContract", + modelProperties: { createdDate: { serializedName: "properties.createdDate", type: { @@ -1706,15 +1741,54 @@ export const IssueContract: msRest.CompositeMapper = { name: "String" } }, + apiId: { + serializedName: "properties.apiId", + type: { + name: "String" + } + }, + title: { + serializedName: "properties.title", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, userId: { - required: true, serializedName: "properties.userId", type: { name: "String" } + } + } + } +}; + +export const IssueContractBaseProperties: msRest.CompositeMapper = { + serializedName: "IssueContractBaseProperties", + type: { + name: "Composite", + className: "IssueContractBaseProperties", + modelProperties: { + createdDate: { + serializedName: "createdDate", + type: { + name: "DateTime" + } + }, + state: { + serializedName: "state", + type: { + name: "String" + } }, apiId: { - serializedName: "properties.apiId", + serializedName: "apiId", type: { name: "String" } diff --git a/packages/@azure/arm-apimanagement/lib/operations/apiIssue.ts b/packages/@azure/arm-apimanagement/lib/operations/apiIssue.ts index 00fd75cccc25..7d46f0c01d3f 100644 --- a/packages/@azure/arm-apimanagement/lib/operations/apiIssue.ts +++ b/packages/@azure/arm-apimanagement/lib/operations/apiIssue.ts @@ -186,6 +186,50 @@ export class ApiIssue { callback) as Promise; } + /** + * Updates an existing issue for an API. + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param parameters Update parameters. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, parameters: Models.IssueUpdateContract, options?: Models.ApiIssueUpdateOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param parameters Update parameters. + * @param callback The callback + */ + update(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, parameters: Models.IssueUpdateContract, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param parameters Update parameters. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, parameters: Models.IssueUpdateContract, options: Models.ApiIssueUpdateOptionalParams, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, parameters: Models.IssueUpdateContract, options?: Models.ApiIssueUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + serviceName, + apiId, + issueId, + parameters, + options + }, + updateOperationSpec, + callback); + } + /** * Deletes the specified Issue from an API. * @param resourceGroupName The name of the resource group. @@ -386,6 +430,39 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { serializer }; +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.apiId1, + Parameters.issueId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.ifMatch1, + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.IssueUpdateContract, + required: true + } + }, + responses: { + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + const deleteMethodOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}",