Skip to content
Closed
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
7 changes: 5 additions & 2 deletions packages/@azure/graph/lib/graphRbacManagementClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class GraphRbacManagementClient extends GraphRbacManagementClientContext {
deletedApplications: operations.DeletedApplications;
groups: operations.Groups;
servicePrincipals: operations.ServicePrincipals;
servicePrincipalsByAppId: operations.ServicePrincipalsByAppId;
users: operations.Users;
objects: operations.Objects;
domains: operations.Domains;
Expand All @@ -31,15 +32,17 @@ class GraphRbacManagementClient extends GraphRbacManagementClientContext {
* Initializes a new instance of the GraphRbacManagementClient class.
* @param credentials Credentials needed for the client to connect to Azure.
* @param tenantID The tenant ID.
* @param applicationID The application ID.
* @param [options] The parameter options
*/
constructor(credentials: msRest.ServiceClientCredentials, tenantID: string, options?: Models.GraphRbacManagementClientOptions) {
super(credentials, tenantID, options);
constructor(credentials: msRest.ServiceClientCredentials, tenantID: string, applicationID: string, options?: Models.GraphRbacManagementClientOptions) {
super(credentials, tenantID, applicationID, options);
this.signedInUser = new operations.SignedInUser(this);
this.applications = new operations.Applications(this);
this.deletedApplications = new operations.DeletedApplications(this);
this.groups = new operations.Groups(this);
this.servicePrincipals = new operations.ServicePrincipals(this);
this.servicePrincipalsByAppId = new operations.ServicePrincipalsByAppId(this);
this.users = new operations.Users(this);
this.objects = new operations.Objects(this);
this.domains = new operations.Domains(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,25 @@ export class GraphRbacManagementClientContext extends msRestAzure.AzureServiceCl
credentials: msRest.ServiceClientCredentials;
apiVersion?: string;
tenantID: string;
applicationID: string;

/**
* Initializes a new instance of the GraphRbacManagementClient class.
* @param credentials Credentials needed for the client to connect to Azure.
* @param tenantID The tenant ID.
* @param applicationID The application ID.
* @param [options] The parameter options
*/
constructor(credentials: msRest.ServiceClientCredentials, tenantID: string, options?: Models.GraphRbacManagementClientOptions) {
constructor(credentials: msRest.ServiceClientCredentials, tenantID: string, applicationID: string, options?: Models.GraphRbacManagementClientOptions) {
if (credentials == undefined) {
throw new Error('\'credentials\' cannot be null.');
}
if (tenantID == undefined) {
throw new Error('\'tenantID\' cannot be null.');
}
if (applicationID == undefined) {
throw new Error('\'applicationID\' cannot be null.');
}

if (!options) {
options = {};
Expand All @@ -51,6 +56,7 @@ export class GraphRbacManagementClientContext extends msRestAzure.AzureServiceCl
this.requestContentType = "application/json; charset=utf-8";
this.credentials = credentials;
this.tenantID = tenantID;
this.applicationID = applicationID;

if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
Expand Down
36 changes: 36 additions & 0 deletions packages/@azure/graph/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,23 @@ export interface Application {
wwwHomepage?: string;
}

/**
* @interface
* An interface representing ServicePrincipalObjectResult.
* Service Principal Object Result.
*
*/
export interface ServicePrincipalObjectResult {
/**
* @member {string} [value] Service Principal Application Object Id
*/
value?: string;
/**
* @member {string} [odatametadata] The URL representing edm equivalent.
*/
odatametadata?: string;
}

/**
* @interface
* An interface representing AddOwnerParameters.
Expand Down Expand Up @@ -2488,6 +2505,25 @@ export type ServicePrincipalsListOwnersNextResponse = DirectoryObjectListResult
};
};

/**
* Contains response data for the get operation.
*/
export type ServicePrincipalsByAppIdGetResponse = ServicePrincipalObjectResult & {
/**
* 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: ServicePrincipalObjectResult;
};
};

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

export const ServicePrincipalObjectResult: msRest.CompositeMapper = {
serializedName: "ServicePrincipalObjectResult",
type: {
name: "Composite",
className: "ServicePrincipalObjectResult",
modelProperties: {
value: {
serializedName: "value",
type: {
name: "String"
}
},
odatametadata: {
serializedName: "odata\\.metadata",
type: {
name: "String"
}
}
}
}
};

export const AddOwnerParameters: msRest.CompositeMapper = {
serializedName: "AddOwnerParameters",
type: {
Expand Down
10 changes: 10 additions & 0 deletions packages/@azure/graph/lib/models/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ export const apiVersion: msRest.OperationQueryParameter = {
}
}
};
export const applicationID: msRest.OperationURLParameter = {
parameterPath: "applicationID",
mapper: {
required: true,
serializedName: "applicationID",
type: {
name: "String"
}
}
};
export const applicationObjectId: msRest.OperationURLParameter = {
parameterPath: "applicationObjectId",
mapper: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

export {
discriminators,
ServicePrincipalObjectResult,
GraphError
} from "../models/mappers";

1 change: 1 addition & 0 deletions packages/@azure/graph/lib/operations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export * from "./applications";
export * from "./deletedApplications";
export * from "./groups";
export * from "./servicePrincipals";
export * from "./servicePrincipalsByAppId";
export * from "./users";
export * from "./objects";
export * from "./domains";
Expand Down
78 changes: 78 additions & 0 deletions packages/@azure/graph/lib/operations/servicePrincipalsByAppId.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/servicePrincipalsByAppIdMappers";
import * as Parameters from "../models/parameters";
import { GraphRbacManagementClientContext } from "../graphRbacManagementClientContext";

/** Class representing a ServicePrincipalsByAppId. */
export class ServicePrincipalsByAppId {
private readonly client: GraphRbacManagementClientContext;

/**
* Create a ServicePrincipalsByAppId.
* @param {GraphRbacManagementClientContext} client Reference to the service client.
*/
constructor(client: GraphRbacManagementClientContext) {
this.client = client;
}

/**
* Gets an object id for a given application id from the current tenant.
* @param [options] The optional parameters
* @returns Promise<Models.ServicePrincipalsByAppIdGetResponse>
*/
get(options?: msRest.RequestOptionsBase): Promise<Models.ServicePrincipalsByAppIdGetResponse>;
/**
* @param callback The callback
*/
get(callback: msRest.ServiceCallback<Models.ServicePrincipalObjectResult>): void;
/**
* @param options The optional parameters
* @param callback The callback
*/
get(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ServicePrincipalObjectResult>): void;
get(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ServicePrincipalObjectResult>, callback?: msRest.ServiceCallback<Models.ServicePrincipalObjectResult>): Promise<Models.ServicePrincipalsByAppIdGetResponse> {
return this.client.sendOperationRequest(
{
options
},
getOperationSpec,
callback) as Promise<Models.ServicePrincipalsByAppIdGetResponse>;
}
}

// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const getOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "{tenantID}/servicePrincipalsByAppId/{applicationID}/objectId",
urlParameters: [
Parameters.tenantID,
Parameters.applicationID
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.ServicePrincipalObjectResult
},
default: {
bodyMapper: Mappers.GraphError
}
},
serializer
};