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

Add support for show_as_button on organization connections #988

Merged
merged 2 commits into from
Feb 9, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type {
PostInvitationsRequest,
PostMembersRequest,
PostOrganizationMemberRolesRequest,
PostOrganizations201Response,
PostOrganizationsRequest,
GetEnabledConnections200ResponseOneOf,
GetInvitations200ResponseOneOf,
Expand Down Expand Up @@ -831,7 +832,7 @@ export class OrganizationsManager extends BaseAPI {
async create(
bodyParameters: PostOrganizationsRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<GetOrganizations200ResponseOneOfInner>> {
): Promise<ApiResponse<PostOrganizations201Response>> {
const headerParameters: runtime.HTTPHeaders = {};

headerParameters['Content-Type'] = 'application/json';
Expand Down
75 changes: 74 additions & 1 deletion src/management/__generated/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4888,6 +4888,11 @@ export interface GetEnabledConnections200ResponseOneOfInner {
*
*/
assign_membership_on_login: boolean;
/**
* Enables showing a button for the connection in the organization login page. If false, it will be usable only by HRD.
*
*/
show_as_button: boolean;
/**
*/
connection: GetEnabledConnections200ResponseOneOfInnerConnection;
Expand Down Expand Up @@ -7539,7 +7544,12 @@ export interface PatchEnabledConnectionsByConnectionIdRequest {
* When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.
*
*/
assign_membership_on_login: boolean;
assign_membership_on_login?: boolean;
/**
* Enables showing a button for the connection in the organization login page. If false, it will be usable only by HRD.
*
*/
show_as_button?: boolean;
}
/**
*
Expand Down Expand Up @@ -8790,6 +8800,11 @@ export interface PostEnabledConnectionsRequest {
*
*/
assign_membership_on_login?: boolean;
/**
* Enables showing a button for the connection in the organization login page. If false, it will be usable only by HRD.
*
*/
show_as_button?: boolean;
}
/**
*
Expand Down Expand Up @@ -9431,6 +9446,59 @@ export interface PostOrganizationMemberRolesRequest {
*/
roles: Array<string>;
}
/**
*
*/
export interface PostOrganizations201Response {
[key: string]: any | any;
/**
* Organization identifier
*
*/
id: string;
/**
* The name of this organization.
*
*/
name: string;
/**
* Friendly name of this organization.
*
*/
display_name: string;
/**
*/
branding: GetOrganizations200ResponseOneOfInnerBranding;
/**
* Metadata associated with the organization, in the form of an object with string values (max 255 chars). Maximum of 10 metadata properties allowed.
*
*/
metadata: { [key: string]: any };
/**
*/
enabled_connections: Array<PostOrganizations201ResponseEnabledConnectionsInner>;
}
/**
*
*/
export interface PostOrganizations201ResponseEnabledConnectionsInner {
[key: string]: any | any;
/**
* ID of the connection.
*
*/
connection_id: string;
/**
* When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.
*
*/
assign_membership_on_login: boolean;
/**
* Enables showing a button for the connection in the organization login page. If false, it will be usable only by HRD.
*
*/
show_as_button: boolean;
}
/**
*
*/
Expand Down Expand Up @@ -9486,6 +9554,11 @@ export interface PostOrganizationsRequestEnabledConnectionsInner {
*
*/
assign_membership_on_login?: boolean;
/**
* Enables showing a button for the connection in the organization login page. If false, it will be usable only by HRD.
*
*/
show_as_button?: boolean;
}
/**
*
Expand Down
4 changes: 3 additions & 1 deletion test/management/organizations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ describe('OrganizationsManager', () => {
const data = {
id: 'org_id',
connectionId: 'conn_id',
show_as_button: false,
};

beforeEach(() => {
Expand Down Expand Up @@ -484,7 +485,7 @@ describe('OrganizationsManager', () => {
id: 'org_123',
};

const body = { connection_id: '123', assign_membership_on_login: false };
const body = { connection_id: '123', assign_membership_on_login: false, show_as_button: false };

beforeEach(() => {
request = nock(API_URL).post(`/organizations/${data.id}/enabled_connections`).reply(200, {});
Expand Down Expand Up @@ -551,6 +552,7 @@ describe('OrganizationsManager', () => {
const data = {
id: 'org_123',
connectionId: '123',
show_as_button: false,
};
const body = { assign_membership_on_login: false };

Expand Down