Skip to content

Commit

Permalink
[AutoPR apimanagement/resource-manager] /identity endpoint added (#484)
Browse files Browse the repository at this point in the history
* Generated from 8363d68686accd9a2c5c1727ebab556ca7529cb3

/identity endpoint added

* Generated from 8363d68686accd9a2c5c1727ebab556ca7529cb3

/identity endpoint added
  • Loading branch information
AutorestCI authored Nov 14, 2018
1 parent ac48e27 commit 993250f
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 2 deletions.
30 changes: 30 additions & 0 deletions packages/@azure/arm-apimanagement/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5111,6 +5111,17 @@ export interface UserUpdateParameters {
lastName?: string;
}

/**
* @interface
* An interface representing CurrentUserIdentity.
*/
export interface CurrentUserIdentity {
/**
* @member {string} [id] API Management service user id.
*/
id?: string;
}

/**
* @interface
* An interface representing ApiVersionSetContract.
Expand Down Expand Up @@ -13665,6 +13676,25 @@ export type TenantConfigurationBeginValidateResponse = OperationResultContract &
};
};

/**
* Contains response data for the getIdentity operation.
*/
export type UserGetIdentityResponse = CurrentUserIdentity & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: CurrentUserIdentity;
};
};

/**
* Contains response data for the listByService operation.
*/
Expand Down
16 changes: 16 additions & 0 deletions packages/@azure/arm-apimanagement/lib/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7151,6 +7151,22 @@ export const UserUpdateParameters: msRest.CompositeMapper = {
}
};

export const CurrentUserIdentity: msRest.CompositeMapper = {
serializedName: "CurrentUserIdentity",
type: {
name: "Composite",
className: "CurrentUserIdentity",
modelProperties: {
id: {
serializedName: "id",
type: {
name: "String"
}
}
}
}
};

export const ApiVersionSetContract: msRest.CompositeMapper = {
serializedName: "ApiVersionSetContract",
type: {
Expand Down
5 changes: 3 additions & 2 deletions packages/@azure/arm-apimanagement/lib/models/userMappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
*/

export {
CurrentUserIdentity,
ErrorResponse,
ErrorFieldContract,
UserCollection,
UserContract,
Resource,
BaseResource,
UserIdentityContract,
GroupContractProperties,
ErrorResponse,
ErrorFieldContract,
UserGetEntityTagHeaders,
UserGetHeaders,
UserCreateParameters,
Expand Down
57 changes: 57 additions & 0 deletions packages/@azure/arm-apimanagement/lib/operations/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,38 @@ export class User {
this.client = client;
}

/**
* Returns calling user identity information.
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the API Management service.
* @param [options] The optional parameters
* @returns Promise<Models.UserGetIdentityResponse>
*/
getIdentity(resourceGroupName: string, serviceName: string, options?: msRest.RequestOptionsBase): Promise<Models.UserGetIdentityResponse>;
/**
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the API Management service.
* @param callback The callback
*/
getIdentity(resourceGroupName: string, serviceName: string, callback: msRest.ServiceCallback<Models.CurrentUserIdentity>): void;
/**
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the API Management service.
* @param options The optional parameters
* @param callback The callback
*/
getIdentity(resourceGroupName: string, serviceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CurrentUserIdentity>): void;
getIdentity(resourceGroupName: string, serviceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CurrentUserIdentity>, callback?: msRest.ServiceCallback<Models.CurrentUserIdentity>): Promise<Models.UserGetIdentityResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
serviceName,
options
},
getIdentityOperationSpec,
callback) as Promise<Models.UserGetIdentityResponse>;
}

/**
* Lists a collection of registered users in the specified service instance.
* @param resourceGroupName The name of the resource group.
Expand Down Expand Up @@ -368,6 +400,31 @@ export class User {

// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const getIdentityOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identity",
urlParameters: [
Parameters.resourceGroupName,
Parameters.serviceName,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.CurrentUserIdentity
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
serializer
};

const listByServiceOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users",
Expand Down

0 comments on commit 993250f

Please sign in to comment.