From 55849b2667173ad22825cba28fa9bb3f74a261d0 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 12 Nov 2024 19:35:20 +0000
Subject: [PATCH] feat(api): api update (#2120)
---
.stats.yml | 2 +-
api.md | 12 +-
src/index.ts | 2 -
src/resources/accounts/accounts.ts | 34 +++-
src/resources/accounts/index.ts | 10 +-
src/resources/accounts/members.ts | 314 ++++++++++++++++++-----------
src/resources/accounts/roles.ts | 108 +++++++++-
src/resources/memberships.ts | 6 +-
src/resources/shared.ts | 128 +-----------
src/resources/user/index.ts | 9 +-
src/resources/user/invites.ts | 25 +--
src/resources/user/user.ts | 11 +-
12 files changed, 352 insertions(+), 309 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 3d58470f94..d575e78779 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
configured_endpoints: 1365
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8ab175377b40ec09207fa70914e51f8bec9d6030f6f628635d56f4c3321d4809.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4593529df2c582c5e4de92308af748d9f8abbca6c92fff7e99e08bd463b7271e.yml
diff --git a/api.md b/api.md
index 8fb3964c37..623252f91b 100644
--- a/api.md
+++ b/api.md
@@ -10,14 +10,12 @@ Types:
- ErrorData
- Identifier
- LoadBalancerPreview
-- Member
- PaginationInfo
- Permission
- PermissionGrant
- RatePlan
- ResponseInfo
- Result
-- Role
- SortDirection
- Subscription
- SubscriptionComponent
@@ -43,7 +41,6 @@ Methods:
Types:
- Status
-- UserWithInviteCode
- MemberCreateResponse
- MemberUpdateResponse
- MemberListResponse
@@ -62,11 +59,12 @@ Methods:
Types:
+- RoleListResponse
- RoleGetResponse
Methods:
-- client.accounts.roles.list({ ...params }) -> RolesSinglePage
+- client.accounts.roles.list({ ...params }) -> RoleListResponsesSinglePage
- client.accounts.roles.get(roleId, { ...params }) -> RoleGetResponse
## Subscriptions
@@ -172,14 +170,12 @@ Methods:
Types:
- Invite
-- InviteEditResponse
-- InviteGetResponse
Methods:
- client.user.invites.list() -> InvitesSinglePage
-- client.user.invites.edit(inviteId, { ...params }) -> InviteEditResponse
-- client.user.invites.get(inviteId) -> InviteGetResponse
+- client.user.invites.edit(inviteId, { ...params }) -> Invite
+- client.user.invites.get(inviteId) -> Invite
## Organizations
diff --git a/src/index.ts b/src/index.ts
index d4c9480ed5..0c875cddd4 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -808,14 +808,12 @@ export declare namespace Cloudflare {
export type ErrorData = API.ErrorData;
export type Identifier = API.Identifier;
export type LoadBalancerPreview = API.LoadBalancerPreview;
- export type Member = API.Member;
export type PaginationInfo = API.PaginationInfo;
export type Permission = API.Permission;
export type PermissionGrant = API.PermissionGrant;
export type RatePlan = API.RatePlan;
export type ResponseInfo = API.ResponseInfo;
export type Result = API.Result;
- export type Role = API.Role;
export type SortDirection = API.SortDirection;
export type Subscription = API.Subscription;
export type SubscriptionComponent = API.SubscriptionComponent;
diff --git a/src/resources/accounts/accounts.ts b/src/resources/accounts/accounts.ts
index ad3a0a4609..59d7f2ea1d 100644
--- a/src/resources/accounts/accounts.ts
+++ b/src/resources/accounts/accounts.ts
@@ -18,10 +18,16 @@ import {
MemberUpdateResponse,
Members,
Status,
- UserWithInviteCode,
} from './members';
import * as RolesAPI from './roles';
-import { RoleGetParams, RoleGetResponse, RoleListParams, Roles } from './roles';
+import {
+ RoleGetParams,
+ RoleGetResponse,
+ RoleListParams,
+ RoleListResponse,
+ RoleListResponsesSinglePage,
+ Roles,
+} from './roles';
import * as SubscriptionsAPI from './subscriptions';
import {
SubscriptionCreateParams,
@@ -143,8 +149,8 @@ export namespace Account {
abuse_contact_email?: string;
/**
- * Specifies the default nameservers to be used for new zones added to this
- * account.
+ * @deprecated: Specifies the default nameservers to be used for new zones added to
+ * this account.
*
* - `cloudflare.standard` for Cloudflare-branded nameservers
* - `custom.account` for account custom nameservers
@@ -153,6 +159,9 @@ export namespace Account {
* See
* [Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/)
* for more information.
+ *
+ * Deprecated in favor of
+ * [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).
*/
default_nameservers?: 'cloudflare.standard' | 'custom.account' | 'custom.tenant';
@@ -166,7 +175,8 @@ export namespace Account {
* @deprecated: Indicates whether new zones should use the account-level custom
* nameservers by default.
*
- * Deprecated in favor of `default_nameservers`.
+ * Deprecated in favor of
+ * [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).
*/
use_account_custom_ns_by_default?: boolean;
}
@@ -241,8 +251,8 @@ export namespace AccountUpdateParams {
abuse_contact_email?: string;
/**
- * Specifies the default nameservers to be used for new zones added to this
- * account.
+ * @deprecated: Specifies the default nameservers to be used for new zones added to
+ * this account.
*
* - `cloudflare.standard` for Cloudflare-branded nameservers
* - `custom.account` for account custom nameservers
@@ -251,6 +261,9 @@ export namespace AccountUpdateParams {
* See
* [Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/)
* for more information.
+ *
+ * Deprecated in favor of
+ * [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).
*/
default_nameservers?: 'cloudflare.standard' | 'custom.account' | 'custom.tenant';
@@ -264,7 +277,8 @@ export namespace AccountUpdateParams {
* @deprecated: Indicates whether new zones should use the account-level custom
* nameservers by default.
*
- * Deprecated in favor of `default_nameservers`.
+ * Deprecated in favor of
+ * [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).
*/
use_account_custom_ns_by_default?: boolean;
}
@@ -299,13 +313,13 @@ export interface AccountGetParams {
Accounts.Members = Members;
Accounts.MemberListResponsesV4PagePaginationArray = MemberListResponsesV4PagePaginationArray;
Accounts.Roles = Roles;
+Accounts.RoleListResponsesSinglePage = RoleListResponsesSinglePage;
Accounts.Subscriptions = Subscriptions;
export declare namespace Accounts {
export {
Members as Members,
type Status as Status,
- type UserWithInviteCode as UserWithInviteCode,
type MemberCreateResponse as MemberCreateResponse,
type MemberUpdateResponse as MemberUpdateResponse,
type MemberListResponse as MemberListResponse,
@@ -321,7 +335,9 @@ export declare namespace Accounts {
export {
Roles as Roles,
+ type RoleListResponse as RoleListResponse,
type RoleGetResponse as RoleGetResponse,
+ RoleListResponsesSinglePage as RoleListResponsesSinglePage,
type RoleListParams as RoleListParams,
type RoleGetParams as RoleGetParams,
};
diff --git a/src/resources/accounts/index.ts b/src/resources/accounts/index.ts
index 8961c1ea20..194fba0fa9 100644
--- a/src/resources/accounts/index.ts
+++ b/src/resources/accounts/index.ts
@@ -5,7 +5,6 @@ export {
MemberListResponsesV4PagePaginationArray,
Members,
type Status,
- type UserWithInviteCode,
type MemberCreateResponse,
type MemberUpdateResponse,
type MemberListResponse,
@@ -17,7 +16,14 @@ export {
type MemberDeleteParams,
type MemberGetParams,
} from './members';
-export { Roles, type RoleGetResponse, type RoleListParams, type RoleGetParams } from './roles';
+export {
+ RoleListResponsesSinglePage,
+ Roles,
+ type RoleListResponse,
+ type RoleGetResponse,
+ type RoleListParams,
+ type RoleGetParams,
+} from './roles';
export {
Subscriptions,
type SubscriptionCreateResponse,
diff --git a/src/resources/accounts/members.ts b/src/resources/accounts/members.ts
index 894fe14074..83f7e58e4b 100644
--- a/src/resources/accounts/members.ts
+++ b/src/resources/accounts/members.ts
@@ -90,113 +90,6 @@ export class MemberListResponsesV4PagePaginationArray extends V4PagePaginationAr
*/
export type Status = 'member' | 'invited';
-export interface UserWithInviteCode {
- /**
- * Membership identifier tag.
- */
- id?: string;
-
- /**
- * The unique activation code for the account membership.
- */
- code?: string;
-
- /**
- * Roles assigned to this member.
- */
- roles?: Array;
-
- /**
- * A member's status in the account.
- */
- status?: 'accepted' | 'pending';
-
- /**
- * Details of the user associated to the membership.
- */
- user?: UserWithInviteCode.User;
-}
-
-export namespace UserWithInviteCode {
- export interface Role {
- /**
- * Role identifier tag.
- */
- id: string;
-
- /**
- * Description of role's permissions.
- */
- description: string;
-
- /**
- * Role name.
- */
- name: string;
-
- permissions: Role.Permissions;
- }
-
- export namespace Role {
- export interface Permissions {
- analytics?: Shared.PermissionGrant;
-
- billing?: Shared.PermissionGrant;
-
- cache_purge?: Shared.PermissionGrant;
-
- dns?: Shared.PermissionGrant;
-
- dns_records?: Shared.PermissionGrant;
-
- lb?: Shared.PermissionGrant;
-
- logs?: Shared.PermissionGrant;
-
- organization?: Shared.PermissionGrant;
-
- ssl?: Shared.PermissionGrant;
-
- waf?: Shared.PermissionGrant;
-
- zone_settings?: Shared.PermissionGrant;
-
- zones?: Shared.PermissionGrant;
- }
- }
-
- /**
- * Details of the user associated to the membership.
- */
- export interface User {
- /**
- * The contact email address of the user.
- */
- email: string;
-
- /**
- * Identifier
- */
- id?: string;
-
- /**
- * User's first name
- */
- first_name?: string | null;
-
- /**
- * User's last name
- */
- last_name?: string | null;
-
- /**
- * Indicates whether two-factor authentication is enabled for the user account.
- * Does not apply to API authentication.
- */
- two_factor_authentication_enabled?: boolean;
- }
-}
-
export interface MemberCreateResponse {
/**
* Membership identifier tag.
@@ -211,7 +104,7 @@ export interface MemberCreateResponse {
/**
* Roles assigned to this Member.
*/
- roles?: Array;
+ roles?: Array;
/**
* A member's status in the account.
@@ -347,6 +240,53 @@ export namespace MemberCreateResponse {
}
}
+ export interface Role {
+ /**
+ * Role identifier tag.
+ */
+ id: string;
+
+ /**
+ * Description of role's permissions.
+ */
+ description: string;
+
+ /**
+ * Role name.
+ */
+ name: string;
+
+ permissions: Role.Permissions;
+ }
+
+ export namespace Role {
+ export interface Permissions {
+ analytics?: Shared.PermissionGrant;
+
+ billing?: Shared.PermissionGrant;
+
+ cache_purge?: Shared.PermissionGrant;
+
+ dns?: Shared.PermissionGrant;
+
+ dns_records?: Shared.PermissionGrant;
+
+ lb?: Shared.PermissionGrant;
+
+ logs?: Shared.PermissionGrant;
+
+ organization?: Shared.PermissionGrant;
+
+ ssl?: Shared.PermissionGrant;
+
+ waf?: Shared.PermissionGrant;
+
+ zone_settings?: Shared.PermissionGrant;
+
+ zones?: Shared.PermissionGrant;
+ }
+ }
+
/**
* Details of the user associated to the membership.
*/
@@ -393,7 +333,7 @@ export interface MemberUpdateResponse {
/**
* Roles assigned to this Member.
*/
- roles?: Array;
+ roles?: Array;
/**
* A member's status in the account.
@@ -529,6 +469,53 @@ export namespace MemberUpdateResponse {
}
}
+ export interface Role {
+ /**
+ * Role identifier tag.
+ */
+ id: string;
+
+ /**
+ * Description of role's permissions.
+ */
+ description: string;
+
+ /**
+ * Role name.
+ */
+ name: string;
+
+ permissions: Role.Permissions;
+ }
+
+ export namespace Role {
+ export interface Permissions {
+ analytics?: Shared.PermissionGrant;
+
+ billing?: Shared.PermissionGrant;
+
+ cache_purge?: Shared.PermissionGrant;
+
+ dns?: Shared.PermissionGrant;
+
+ dns_records?: Shared.PermissionGrant;
+
+ lb?: Shared.PermissionGrant;
+
+ logs?: Shared.PermissionGrant;
+
+ organization?: Shared.PermissionGrant;
+
+ ssl?: Shared.PermissionGrant;
+
+ waf?: Shared.PermissionGrant;
+
+ zone_settings?: Shared.PermissionGrant;
+
+ zones?: Shared.PermissionGrant;
+ }
+ }
+
/**
* Details of the user associated to the membership.
*/
@@ -575,7 +562,7 @@ export interface MemberListResponse {
/**
* Roles assigned to this Member.
*/
- roles?: Array;
+ roles?: Array;
/**
* A member's status in the account.
@@ -711,6 +698,53 @@ export namespace MemberListResponse {
}
}
+ export interface Role {
+ /**
+ * Role identifier tag.
+ */
+ id: string;
+
+ /**
+ * Description of role's permissions.
+ */
+ description: string;
+
+ /**
+ * Role name.
+ */
+ name: string;
+
+ permissions: Role.Permissions;
+ }
+
+ export namespace Role {
+ export interface Permissions {
+ analytics?: Shared.PermissionGrant;
+
+ billing?: Shared.PermissionGrant;
+
+ cache_purge?: Shared.PermissionGrant;
+
+ dns?: Shared.PermissionGrant;
+
+ dns_records?: Shared.PermissionGrant;
+
+ lb?: Shared.PermissionGrant;
+
+ logs?: Shared.PermissionGrant;
+
+ organization?: Shared.PermissionGrant;
+
+ ssl?: Shared.PermissionGrant;
+
+ waf?: Shared.PermissionGrant;
+
+ zone_settings?: Shared.PermissionGrant;
+
+ zones?: Shared.PermissionGrant;
+ }
+ }
+
/**
* Details of the user associated to the membership.
*/
@@ -764,7 +798,7 @@ export interface MemberGetResponse {
/**
* Roles assigned to this Member.
*/
- roles?: Array;
+ roles?: Array;
/**
* A member's status in the account.
@@ -900,6 +934,53 @@ export namespace MemberGetResponse {
}
}
+ export interface Role {
+ /**
+ * Role identifier tag.
+ */
+ id: string;
+
+ /**
+ * Description of role's permissions.
+ */
+ description: string;
+
+ /**
+ * Role name.
+ */
+ name: string;
+
+ permissions: Role.Permissions;
+ }
+
+ export namespace Role {
+ export interface Permissions {
+ analytics?: Shared.PermissionGrant;
+
+ billing?: Shared.PermissionGrant;
+
+ cache_purge?: Shared.PermissionGrant;
+
+ dns?: Shared.PermissionGrant;
+
+ dns_records?: Shared.PermissionGrant;
+
+ lb?: Shared.PermissionGrant;
+
+ logs?: Shared.PermissionGrant;
+
+ organization?: Shared.PermissionGrant;
+
+ ssl?: Shared.PermissionGrant;
+
+ waf?: Shared.PermissionGrant;
+
+ zone_settings?: Shared.PermissionGrant;
+
+ zones?: Shared.PermissionGrant;
+ }
+ }
+
/**
* Details of the user associated to the membership.
*/
@@ -1023,10 +1104,12 @@ export namespace MemberCreateParams {
}
}
-export type MemberUpdateParams = MemberUpdateParams.Member | MemberUpdateParams.IAMUpdateMemberWithPolicies;
+export type MemberUpdateParams =
+ | MemberUpdateParams.IAMUpdateMemberWithRoles
+ | MemberUpdateParams.IAMUpdateMemberWithPolicies;
export namespace MemberUpdateParams {
- export interface Member {
+ export interface IAMUpdateMemberWithRoles {
/**
* Path param: Account identifier tag.
*/
@@ -1035,10 +1118,10 @@ export namespace MemberUpdateParams {
/**
* Body param: Roles assigned to this member.
*/
- roles?: Array;
+ roles?: Array;
}
- export namespace Member {
+ export namespace IAMUpdateMemberWithRoles {
export interface Role {
/**
* Role identifier tag.
@@ -1142,7 +1225,6 @@ Members.MemberListResponsesV4PagePaginationArray = MemberListResponsesV4PagePagi
export declare namespace Members {
export {
type Status as Status,
- type UserWithInviteCode as UserWithInviteCode,
type MemberCreateResponse as MemberCreateResponse,
type MemberUpdateResponse as MemberUpdateResponse,
type MemberListResponse as MemberListResponse,
diff --git a/src/resources/accounts/roles.ts b/src/resources/accounts/roles.ts
index eeabb13320..fc985389e8 100644
--- a/src/resources/accounts/roles.ts
+++ b/src/resources/accounts/roles.ts
@@ -3,7 +3,7 @@
import { APIResource } from '../../resource';
import * as Core from '../../core';
import * as Shared from '../shared';
-import { RolesSinglePage } from '../shared';
+import { SinglePage } from '../../pagination';
export class Roles extends APIResource {
/**
@@ -12,9 +12,9 @@ export class Roles extends APIResource {
list(
params: RoleListParams,
options?: Core.RequestOptions,
- ): Core.PagePromise {
+ ): Core.PagePromise {
const { account_id } = params;
- return this._client.getAPIList(`/accounts/${account_id}/roles`, RolesSinglePage, options);
+ return this._client.getAPIList(`/accounts/${account_id}/roles`, RoleListResponsesSinglePage, options);
}
/**
@@ -34,7 +34,101 @@ export class Roles extends APIResource {
}
}
-export type RoleGetResponse = unknown;
+export class RoleListResponsesSinglePage extends SinglePage {}
+
+export interface RoleListResponse {
+ /**
+ * Role identifier tag.
+ */
+ id: string;
+
+ /**
+ * Description of role's permissions.
+ */
+ description: string;
+
+ /**
+ * Role name.
+ */
+ name: string;
+
+ permissions: RoleListResponse.Permissions;
+}
+
+export namespace RoleListResponse {
+ export interface Permissions {
+ analytics?: Shared.PermissionGrant;
+
+ billing?: Shared.PermissionGrant;
+
+ cache_purge?: Shared.PermissionGrant;
+
+ dns?: Shared.PermissionGrant;
+
+ dns_records?: Shared.PermissionGrant;
+
+ lb?: Shared.PermissionGrant;
+
+ logs?: Shared.PermissionGrant;
+
+ organization?: Shared.PermissionGrant;
+
+ ssl?: Shared.PermissionGrant;
+
+ waf?: Shared.PermissionGrant;
+
+ zone_settings?: Shared.PermissionGrant;
+
+ zones?: Shared.PermissionGrant;
+ }
+}
+
+export interface RoleGetResponse {
+ /**
+ * Role identifier tag.
+ */
+ id: string;
+
+ /**
+ * Description of role's permissions.
+ */
+ description: string;
+
+ /**
+ * Role name.
+ */
+ name: string;
+
+ permissions: RoleGetResponse.Permissions;
+}
+
+export namespace RoleGetResponse {
+ export interface Permissions {
+ analytics?: Shared.PermissionGrant;
+
+ billing?: Shared.PermissionGrant;
+
+ cache_purge?: Shared.PermissionGrant;
+
+ dns?: Shared.PermissionGrant;
+
+ dns_records?: Shared.PermissionGrant;
+
+ lb?: Shared.PermissionGrant;
+
+ logs?: Shared.PermissionGrant;
+
+ organization?: Shared.PermissionGrant;
+
+ ssl?: Shared.PermissionGrant;
+
+ waf?: Shared.PermissionGrant;
+
+ zone_settings?: Shared.PermissionGrant;
+
+ zones?: Shared.PermissionGrant;
+ }
+}
export interface RoleListParams {
/**
@@ -50,12 +144,14 @@ export interface RoleGetParams {
account_id: string;
}
+Roles.RoleListResponsesSinglePage = RoleListResponsesSinglePage;
+
export declare namespace Roles {
export {
+ type RoleListResponse as RoleListResponse,
type RoleGetResponse as RoleGetResponse,
+ RoleListResponsesSinglePage as RoleListResponsesSinglePage,
type RoleListParams as RoleListParams,
type RoleGetParams as RoleGetParams,
};
}
-
-export { RolesSinglePage };
diff --git a/src/resources/memberships.ts b/src/resources/memberships.ts
index 18bed3896a..1f851d6f85 100644
--- a/src/resources/memberships.ts
+++ b/src/resources/memberships.ts
@@ -86,7 +86,7 @@ export interface Membership {
permissions?: Membership.Permissions;
/**
- * List of role names for the user at the account.
+ * List of role names the membership has for this account.
*/
roles?: Array;
@@ -152,7 +152,7 @@ export interface MembershipUpdateResponse {
policies?: Array;
/**
- * List of role names for the user at the account.
+ * List of role names the membership has for this account.
*/
roles?: Array;
@@ -347,7 +347,7 @@ export interface MembershipGetResponse {
policies?: Array;
/**
- * List of role names for the user at the account.
+ * List of role names the membership has for this account.
*/
roles?: Array;
diff --git a/src/resources/shared.ts b/src/resources/shared.ts
index 6200cbd15e..32b96e642d 100644
--- a/src/resources/shared.ts
+++ b/src/resources/shared.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import * as Shared from './shared';
-import { SinglePage, V4PagePaginationArray } from '../pagination';
+import { V4PagePaginationArray } from '../pagination';
export type ASN = number;
@@ -267,108 +267,6 @@ export interface LoadBalancerPreview {
preview_id?: string;
}
-export interface Member {
- /**
- * Membership identifier tag.
- */
- id?: string;
-
- /**
- * Roles assigned to this member.
- */
- roles?: Array;
-
- /**
- * A member's status in the account.
- */
- status?: 'accepted' | 'pending';
-
- /**
- * Details of the user associated to the membership.
- */
- user?: Member.User;
-}
-
-export namespace Member {
- export interface Role {
- /**
- * Role identifier tag.
- */
- id: string;
-
- /**
- * Description of role's permissions.
- */
- description: string;
-
- /**
- * Role name.
- */
- name: string;
-
- permissions: Role.Permissions;
- }
-
- export namespace Role {
- export interface Permissions {
- analytics?: Shared.PermissionGrant;
-
- billing?: Shared.PermissionGrant;
-
- cache_purge?: Shared.PermissionGrant;
-
- dns?: Shared.PermissionGrant;
-
- dns_records?: Shared.PermissionGrant;
-
- lb?: Shared.PermissionGrant;
-
- logs?: Shared.PermissionGrant;
-
- organization?: Shared.PermissionGrant;
-
- ssl?: Shared.PermissionGrant;
-
- waf?: Shared.PermissionGrant;
-
- zone_settings?: Shared.PermissionGrant;
-
- zones?: Shared.PermissionGrant;
- }
- }
-
- /**
- * Details of the user associated to the membership.
- */
- export interface User {
- /**
- * The contact email address of the user.
- */
- email: string;
-
- /**
- * Identifier
- */
- id?: string;
-
- /**
- * User's first name
- */
- first_name?: string | null;
-
- /**
- * User's last name
- */
- last_name?: string | null;
-
- /**
- * Indicates whether two-factor authentication is enabled for the user account.
- * Does not apply to API authentication.
- */
- two_factor_authentication_enabled?: boolean;
- }
-}
-
export interface PaginationInfo {
/**
* Total number of results for the requested service
@@ -516,28 +414,6 @@ export namespace Result {
}
}
-export interface Role {
- /**
- * Role identifier tag.
- */
- id: string;
-
- /**
- * Description of role's permissions.
- */
- description: string;
-
- /**
- * Role Name.
- */
- name: string;
-
- /**
- * Access permissions for this User.
- */
- permissions: Array;
-}
-
/**
* Direction to order DNS records in.
*/
@@ -631,6 +507,4 @@ export interface SubscriptionZone {
name?: string;
}
-export class RolesSinglePage extends SinglePage {}
-
export class AuditLogsV4PagePaginationArray extends V4PagePaginationArray {}
diff --git a/src/resources/user/index.ts b/src/resources/user/index.ts
index 82d7f63d60..9a84206768 100644
--- a/src/resources/user/index.ts
+++ b/src/resources/user/index.ts
@@ -2,14 +2,7 @@
export { AuditLogs, type AuditLogListParams } from './audit-logs';
export { Billing } from './billing/index';
-export {
- InvitesSinglePage,
- Invites,
- type Invite,
- type InviteEditResponse,
- type InviteGetResponse,
- type InviteEditParams,
-} from './invites';
+export { InvitesSinglePage, Invites, type Invite, type InviteEditParams } from './invites';
export {
OrganizationsV4PagePaginationArray,
Organizations,
diff --git a/src/resources/user/invites.ts b/src/resources/user/invites.ts
index f26f23a8b7..48ee5f675e 100644
--- a/src/resources/user/invites.ts
+++ b/src/resources/user/invites.ts
@@ -2,7 +2,6 @@
import { APIResource } from '../../resource';
import * as Core from '../../core';
-import * as Shared from '../shared';
import { SinglePage } from '../../pagination';
export class Invites extends APIResource {
@@ -16,14 +15,10 @@ export class Invites extends APIResource {
/**
* Responds to an invitation.
*/
- edit(
- inviteId: string,
- body: InviteEditParams,
- options?: Core.RequestOptions,
- ): Core.APIPromise {
+ edit(inviteId: string, body: InviteEditParams, options?: Core.RequestOptions): Core.APIPromise {
return (
this._client.patch(`/user/invites/${inviteId}`, { body, ...options }) as Core.APIPromise<{
- result: InviteEditResponse;
+ result: Invite;
}>
)._thenUnwrap((obj) => obj.result);
}
@@ -31,9 +26,9 @@ export class Invites extends APIResource {
/**
* Gets the details of an invitation.
*/
- get(inviteId: string, options?: Core.RequestOptions): Core.APIPromise {
+ get(inviteId: string, options?: Core.RequestOptions): Core.APIPromise {
return (
- this._client.get(`/user/invites/${inviteId}`, options) as Core.APIPromise<{ result: InviteGetResponse }>
+ this._client.get(`/user/invites/${inviteId}`, options) as Core.APIPromise<{ result: Invite }>
)._thenUnwrap((obj) => obj.result);
}
}
@@ -76,15 +71,17 @@ export interface Invite {
*/
invited_on?: string;
+ organization_is_enforcing_twofactor?: boolean;
+
/**
* Organization name.
*/
organization_name?: string;
/**
- * Roles to be assigned to this user.
+ * List of role names the membership has for this account.
*/
- roles?: Array;
+ roles?: Array;
/**
* Current status of the invitation.
@@ -92,10 +89,6 @@ export interface Invite {
status?: 'pending' | 'accepted' | 'rejected' | 'expired';
}
-export type InviteEditResponse = unknown;
-
-export type InviteGetResponse = unknown;
-
export interface InviteEditParams {
/**
* Status of your response to the invitation (rejected or accepted).
@@ -108,8 +101,6 @@ Invites.InvitesSinglePage = InvitesSinglePage;
export declare namespace Invites {
export {
type Invite as Invite,
- type InviteEditResponse as InviteEditResponse,
- type InviteGetResponse as InviteGetResponse,
InvitesSinglePage as InvitesSinglePage,
type InviteEditParams as InviteEditParams,
};
diff --git a/src/resources/user/user.ts b/src/resources/user/user.ts
index ea4b726185..f9ac0686bf 100644
--- a/src/resources/user/user.ts
+++ b/src/resources/user/user.ts
@@ -5,14 +5,7 @@ import * as Core from '../../core';
import * as AuditLogsAPI from './audit-logs';
import { AuditLogListParams, AuditLogs } from './audit-logs';
import * as InvitesAPI from './invites';
-import {
- Invite,
- InviteEditParams,
- InviteEditResponse,
- InviteGetResponse,
- Invites,
- InvitesSinglePage,
-} from './invites';
+import { Invite, InviteEditParams, Invites, InvitesSinglePage } from './invites';
import * as OrganizationsAPI from './organizations';
import {
Organization,
@@ -126,8 +119,6 @@ export declare namespace User {
export {
Invites as Invites,
type Invite as Invite,
- type InviteEditResponse as InviteEditResponse,
- type InviteGetResponse as InviteGetResponse,
InvitesSinglePage as InvitesSinglePage,
type InviteEditParams as InviteEditParams,
};