Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR apimanagement/resource-manager] Added missing PATCH operation to Api Issue resource #490

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export {
ErrorFieldContract,
ApiIssueGetEntityTagHeaders,
ApiIssueGetHeaders,
IssueUpdateContract,
PolicyContract,
ApiContract,
AuthenticationSettingsContract,
Expand Down
79 changes: 77 additions & 2 deletions packages/@azure/arm-apimanagement/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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.
*/
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
78 changes: 76 additions & 2 deletions packages/@azure/arm-apimanagement/lib/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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: {
Expand All @@ -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"
}
Expand Down
77 changes: 77 additions & 0 deletions packages/@azure/arm-apimanagement/lib/operations/apiIssue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,50 @@ export class ApiIssue {
callback) as Promise<Models.ApiIssueCreateOrUpdateResponse>;
}

/**
* 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<msRest.RestResponse>
*/
update(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, parameters: Models.IssueUpdateContract, options?: Models.ApiIssueUpdateOptionalParams): Promise<msRest.RestResponse>;
/**
* @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>): 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>): void;
update(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, parameters: Models.IssueUpdateContract, options?: Models.ApiIssueUpdateOptionalParams | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<msRest.RestResponse> {
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.
Expand Down Expand Up @@ -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}",
Expand Down