/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { accountManagementGetMemberCreditUsage } from "../funcs/accountManagementGetMemberCreditUsage.js";
import { accountManagementGetOrganizationCredits } from "../funcs/accountManagementGetOrganizationCredits.js";
import { accountManagementGetOrganizationCreditUsage } from "../funcs/accountManagementGetOrganizationCreditUsage.js";
import { accountManagementGetOrganizationDetails } from "../funcs/accountManagementGetOrganizationDetails.js";
import { accountManagementGetUserCredits } from "../funcs/accountManagementGetUserCredits.js";
import { accountManagementGetUserCreditsUsage } from "../funcs/accountManagementGetUserCreditsUsage.js";
import {
accountManagementInviteUserToOrganization,
InviteUserToOrganizationAcceptEnum,
} from "../funcs/accountManagementInviteUserToOrganization.js";
import { accountManagementListOrganizationMembers } from "../funcs/accountManagementListOrganizationMembers.js";
import {
accountManagementRemoveOrganizationMember,
RemoveOrganizationMemberAcceptEnum,
} from "../funcs/accountManagementRemoveOrganizationMember.js";
import {
accountManagementUpdateOrganizationMember,
UpdateOrganizationMemberAcceptEnum,
} from "../funcs/accountManagementUpdateOrganizationMember.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import * as operations from "../models/operations/index.js";
import { unwrapAsync } from "../types/fp.js";
export { InviteUserToOrganizationAcceptEnum } from "../funcs/accountManagementInviteUserToOrganization.js";
export { RemoveOrganizationMemberAcceptEnum } from "../funcs/accountManagementRemoveOrganizationMember.js";
export { UpdateOrganizationMemberAcceptEnum } from "../funcs/accountManagementUpdateOrganizationMember.js";
export class AccountManagement extends ClientSDK {
/**
* Get organization details
*
* @remarks
* Retrieve an organization's details, including the count of organization members broken down by role and organization settings such as AI training and MFA requirements.
This endpoint does not cost any credits to execute.
*/
async getOrganizationDetails(
request: operations.V3AccountmanagementOrgDetailsRequest,
options?: RequestOptions,
): Promise {
return unwrapAsync(accountManagementGetOrganizationDetails(
this,
request,
options,
));
}
/**
* Get organization credit balance
*
* @remarks
* Retrieve credit balance and expiration information for an organization.
Credits expire 12 months after they are acquired.
This endpoint does not cost any credits to execute.
*/
async getOrganizationCredits(
request: operations.V3AccountmanagementOrgCreditsRequest,
options?: RequestOptions,
): Promise {
return unwrapAsync(accountManagementGetOrganizationCredits(
this,
request,
options,
));
}
/**
* Get organization credit usage
*
* @remarks
* Retrieve credit information for an organization over a specific date range. You must include a start date in your request.
Admins can obtain credit usage information for all users in their organization. Members may only retrieve usage information for their own account.
This endpoint does not cost any credits to execute.
*/
async getOrganizationCreditUsage(
request: operations.V3AccountmanagementOrgCreditsUsageRequest,
options?: RequestOptions,
): Promise {
return unwrapAsync(accountManagementGetOrganizationCreditUsage(
this,
request,
options,
));
}
/**
* Invite user to organization
*
* @remarks
* Invite a user to an organization. The user will receive an email to join the organization. This is equivalent to [adding a new member via the UI](https://docs.censys.com/docs/platform-org-management#invite-members).
Only users with the Admin role in the provided organization can perform this operation.
This endpoint does not cost any credits to execute.
*/
async inviteUserToOrganization(
request: operations.V3AccountmanagementInviteUserToOrgRequest,
options?: RequestOptions & {
acceptHeaderOverride?: InviteUserToOrganizationAcceptEnum;
},
): Promise<
operations.V3AccountmanagementInviteUserToOrgResponse | undefined
> {
return unwrapAsync(accountManagementInviteUserToOrganization(
this,
request,
options,
));
}
/**
* List organization members
*
* @remarks
* Retrieve a paginated list of an organization's members and their user details, including their user ID, email, name, creation time, and roles.
This endpoint does not cost any credits to execute.
*/
async listOrganizationMembers(
request: operations.V3AccountmanagementListOrgMembersRequest,
options?: RequestOptions,
): Promise {
return unwrapAsync(accountManagementListOrganizationMembers(
this,
request,
options,
));
}
/**
* Remove member from organization
*
* @remarks
* Remove a user from an organization. This is equivalent to [removing a member via the UI](https://docs.censys.com/docs/platform-org-management#remove-members).
Only users with the Admin role in the provided organization can perform this operation.
This endpoint does not cost any credits to execute.
*/
async removeOrganizationMember(
request: operations.V3AccountmanagementRemoveOrgMemberRequest,
options?: RequestOptions & {
acceptHeaderOverride?: RemoveOrganizationMemberAcceptEnum;
},
): Promise<
operations.V3AccountmanagementRemoveOrgMemberResponse | undefined
> {
return unwrapAsync(accountManagementRemoveOrganizationMember(
this,
request,
options,
));
}
/**
* Update a member's roles in an organization
*
* @remarks
* Update the roles assigned to an organization member. This operation replaces a member's roles with the list provided in the request body. To remove all roles from a member, provide an empty list. To completely remove a member from an organization, use the [remove member endpoint](https://docs.censys.com/reference/v3-accountmanagement-remove-org-member).
Only users with the Admin role in the provided organization can perform this operation.
This endpoint does not cost any credits to execute.
*/
async updateOrganizationMember(
request: operations.V3AccountmanagementUpdateOrgMemberRequest,
options?: RequestOptions & {
acceptHeaderOverride?: UpdateOrganizationMemberAcceptEnum;
},
): Promise<
operations.V3AccountmanagementUpdateOrgMemberResponse | undefined
> {
return unwrapAsync(accountManagementUpdateOrganizationMember(
this,
request,
options,
));
}
/**
* Get organization member credit usage
*
* @remarks
* Retrieve credit consumption information for an organization member over a specific date range. You must include a start date in your request.
This endpoint does not cost any credits to execute.
*/
async getMemberCreditUsage(
request: operations.V3AccountmanagementMemberCreditsUsageRequest,
options?: RequestOptions,
): Promise {
return unwrapAsync(accountManagementGetMemberCreditUsage(
this,
request,
options,
));
}
/**
* Get Free user credit balance
*
* @remarks
* Retrieve your Free user account credit balance and refresh information. To retrieve the credit balance for a Starter or Enterprise account, use the [get organization credit balance endpoint](https://docs.censys.com/reference/v3-accountmanagement-org-credits).
This endpoint does not cost any credits to execute.
*/
async getUserCredits(
options?: RequestOptions,
): Promise {
return unwrapAsync(accountManagementGetUserCredits(
this,
options,
));
}
/**
* Get Free user credit usage
*
* @remarks
* Retrieve your Free user account credit consumption information over a specific date range. You must include a start date in your request.
This endpoint does not cost any credits to execute.
*/
async getUserCreditsUsage(
request: operations.V3AccountmanagementUserCreditsUsageRequest,
options?: RequestOptions,
): Promise {
return unwrapAsync(accountManagementGetUserCreditsUsage(
this,
request,
options,
));
}
}