Skip to content

Commit

Permalink
Integrate Profile Mapping API into v2 client (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandrpravosudko-okta authored Apr 21, 2022
1 parent eb1a88a commit d81b77e
Show file tree
Hide file tree
Showing 15 changed files with 828 additions and 35 deletions.
28 changes: 2 additions & 26 deletions src/generated-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -5685,18 +5685,7 @@ class GeneratedApiClient {
if (!mappingId) {
return Promise.reject(new Error('OKTA API getProfileMapping parameter mappingId is required.'));
}
let url = `${this.baseUrl}/api/v1/mappings/${mappingId}`;

const resources = [
`${this.baseUrl}/api/v1/mappings/${mappingId}`
];

const request = this.http.getJson(
url,
null,
{ resources }
);
return request.then(jsonRes => new models.ProfileMapping(jsonRes, this));
return this.profileMappingApi.getProfileMapping(mappingId);
}

/**
Expand All @@ -5714,20 +5703,7 @@ class GeneratedApiClient {
if (!profileMapping) {
return Promise.reject(new Error('OKTA API updateProfileMapping parameter profileMapping is required.'));
}
let url = `${this.baseUrl}/api/v1/mappings/${mappingId}`;

const resources = [
`${this.baseUrl}/api/v1/mappings/${mappingId}`
];

const request = this.http.postJson(
url,
{
body: profileMapping
},
{ resources }
);
return request.then(jsonRes => new models.ProfileMapping(jsonRes, this));
return this.profileMappingApi.updateProfileMapping(profileMapping, mappingId);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/types/generated-client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ import { InlineHookOptions } from './models/InlineHook';
import { InlineHookPayloadOptions } from './models/InlineHookPayload';
import { InlineHookResponse } from './models/InlineHookResponse';
import { LogEvent } from './models/LogEvent';
import { ProfileMapping } from './models/ProfileMapping';
import { ProfileMapping } from './v3/models';
import { ProfileMappingOptions } from './models/ProfileMapping';
import { UserSchema } from './v3/models';
import { UserSchemaOptions } from './models/UserSchema';
Expand Down
169 changes: 169 additions & 0 deletions src/types/v3/apis/profile-mapping-api.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
/**
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and limitations under the License.
*
* Okta API
* Allows customers to easily access the Okta API
*
* OpenAPI spec version: 2.10.0
* Contact: devex-public@okta.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { RequestArgs, BaseAPI } from '../base';
import { ProfileMapping } from '../models';
import { Http } from '../../http';
import { Collection } from '../../collection';
import type { V2Configuration } from '../../configuration';
import type { Configuration } from '../configuration';
/**
* ProfileMappingApi - request parameter creator
* @export
*/
export declare const ProfileMappingApiRequestParamCreator: (configuration?: Configuration & V2Configuration) => {
http: Http;
/**
* Fetches a single Profile Mapping referenced by its ID.
* @summary Get Profile Mapping
* @param {string} mappingId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getProfileMapping: (mappingId: string, options?: any) => RequestArgs;
/**
* Enumerates Profile Mappings in your organization with pagination.
* @summary List Profile Mappings
* @param {string} [after]
* @param {number} [limit]
* @param {string} [sourceId]
* @param {string} [targetId]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listProfileMappings: (after?: string, limit?: number, sourceId?: string, targetId?: string, options?: any) => RequestArgs;
/**
* Updates an existing Profile Mapping by adding, updating, or removing one or many Property Mappings.
* @summary Update Profile Mapping
* @param {ProfileMapping} body
* @param {string} mappingId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateProfileMapping: (body: ProfileMapping, mappingId: string, options?: any) => RequestArgs;
};
/**
* ProfileMappingApi - functional programming interface
* @export
*/
export declare const ProfileMappingApiFp: (configuration?: Configuration & V2Configuration) => {
/**
* Fetches a single Profile Mapping referenced by its ID.
* @summary Get Profile Mapping
* @param {string} mappingId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getProfileMapping(mappingId: string, options?: any): (http?: Http, basePath?: string) => Promise<ProfileMapping>;
/**
* Enumerates Profile Mappings in your organization with pagination.
* @summary List Profile Mappings
* @param {string} [after]
* @param {number} [limit]
* @param {string} [sourceId]
* @param {string} [targetId]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listProfileMappings(after?: string, limit?: number, sourceId?: string, targetId?: string, options?: any): (http?: Http, basePath?: string) => Collection<ProfileMapping>;
/**
* Updates an existing Profile Mapping by adding, updating, or removing one or many Property Mappings.
* @summary Update Profile Mapping
* @param {ProfileMapping} body
* @param {string} mappingId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateProfileMapping(body: ProfileMapping, mappingId: string, options?: any): (http?: Http, basePath?: string) => Promise<ProfileMapping>;
};
/**
* ProfileMappingApi - factory interface
* @export
*/
export declare const ProfileMappingApiFactory: (configuration?: Configuration, basePath?: string, http?: Http) => {
/**
* Fetches a single Profile Mapping referenced by its ID.
* @summary Get Profile Mapping
* @param {string} mappingId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getProfileMapping(mappingId: string, options?: any): Promise<ProfileMapping>;
/**
* Enumerates Profile Mappings in your organization with pagination.
* @summary List Profile Mappings
* @param {string} [after]
* @param {number} [limit]
* @param {string} [sourceId]
* @param {string} [targetId]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listProfileMappings(after?: string, limit?: number, sourceId?: string, targetId?: string, options?: any): Collection<ProfileMapping>;
/**
* Updates an existing Profile Mapping by adding, updating, or removing one or many Property Mappings.
* @summary Update Profile Mapping
* @param {ProfileMapping} body
* @param {string} mappingId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateProfileMapping(body: ProfileMapping, mappingId: string, options?: any): Promise<ProfileMapping>;
};
/**
* ProfileMappingApi - object-oriented interface
* @export
* @class ProfileMappingApi
* @extends {BaseAPI}
*/
export declare class ProfileMappingApi extends BaseAPI {
/**
* Fetches a single Profile Mapping referenced by its ID.
* @summary Get Profile Mapping
* @param {string} mappingId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ProfileMappingApi
*/
getProfileMapping(mappingId: string, options?: any): Promise<ProfileMapping>;
/**
* Enumerates Profile Mappings in your organization with pagination.
* @summary List Profile Mappings
* @param {string} [after]
* @param {number} [limit]
* @param {string} [sourceId]
* @param {string} [targetId]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ProfileMappingApi
*/
listProfileMappings(after?: string, limit?: number, sourceId?: string, targetId?: string, options?: any): Collection<ProfileMapping>;
/**
* Updates an existing Profile Mapping by adding, updating, or removing one or many Property Mappings.
* @summary Update Profile Mapping
* @param {ProfileMapping} body
* @param {string} mappingId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ProfileMappingApi
*/
updateProfileMapping(body: ProfileMapping, mappingId: string, options?: any): Promise<ProfileMapping>;
}
4 changes: 4 additions & 0 deletions src/types/v3/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ export * from './inline-hook-response-command-value';
export * from './inline-hook-response-commands';
export * from './inline-hook-status';
export * from './inline-hook-type';
export * from './profile-mapping';
export * from './profile-mapping-source';
export * from './profile-mapping-property';
export * from './profile-mapping-property-push-status';
export * from './required-enum';
export * from './user-schema';
export * from './user-schema-attribute';
Expand Down
30 changes: 30 additions & 0 deletions src/types/v3/models/profile-mapping-property-push-status.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and limitations under the License.
*
* Okta API
* Allows customers to easily access the Okta API
*
* OpenAPI spec version: 2.10.0
* Contact: devex-public@okta.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/**
*
* @export
* @enum {string}
*/
export declare enum ProfileMappingPropertyPushStatus {
PUSH = 'PUSH',
DONTPUSH = 'DONT_PUSH'
}
41 changes: 41 additions & 0 deletions src/types/v3/models/profile-mapping-property.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and limitations under the License.
*
* Okta API
* Allows customers to easily access the Okta API
*
* OpenAPI spec version: 2.10.0
* Contact: devex-public@okta.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { ProfileMappingPropertyPushStatus } from './profile-mapping-property-push-status';
/**
*
* @export
* @class ProfileMappingProperty
*/
export interface ProfileMappingProperty {
/**
*
* @type {string}
* @memberof ProfileMappingProperty
*/
expression?: string;
/**
*
* @type {ProfileMappingPropertyPushStatus}
* @memberof ProfileMappingProperty
*/
pushStatus?: ProfileMappingPropertyPushStatus;
}
54 changes: 54 additions & 0 deletions src/types/v3/models/profile-mapping-source.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and limitations under the License.
*
* Okta API
* Allows customers to easily access the Okta API
*
* OpenAPI spec version: 2.10.0
* Contact: devex-public@okta.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/**
*
* @export
* @class ProfileMappingSource
*/
export interface ProfileMappingSource {
/**
*
* @type {{ [key: string]: any; }}
* @memberof ProfileMappingSource
*/
links?: {
[key: string]: any;
};
/**
*
* @type {string}
* @memberof ProfileMappingSource
*/
id?: string;
/**
*
* @type {string}
* @memberof ProfileMappingSource
*/
name?: string;
/**
*
* @type {string}
* @memberof ProfileMappingSource
*/
type?: string;
}
Loading

0 comments on commit d81b77e

Please sign in to comment.