Function: createPolicy()
ts
function createPolicy(
client,
parameters,
options?
): Promise<{
[key: string]: unknown;
data?: {
[key: string]: unknown;
attributes: {
[key: string]: unknown;
createdAt?: string;
id?: string;
metadata?: unknown;
name?: string;
ownerId?: string;
queryData?: unknown;
resources?: object[];
rule?: | unknown[]
| {
[key: string]: unknown;
in?: string[];
};
status?: "disabled" | string & object | "enabled";
type: | string & object
| "ip-allowlist"
| "data-residency"
| "data-security"
| "admin-notification-settings"
| "generative-ai"
| "hipaa"
| "ugc-data-use-preferences"
| "user-join-settings-default";
updatedAt?: string;
};
id: string;
links?: Record<string, any>;
message?: unknown;
type: string & object | "policy";
};
}>;Defined in: src/admin/api/policies.ts:35
Create a policy for an org
Parameters
| Parameter | Type | Description |
|---|---|---|
client | Client | - |
parameters | { data?: { attributes: { name?: string; resources?: object[]; rule?: { in?: string[]; }; status?: "disabled" | string & object | "enabled"; type: string & object | "ip-allowlist" | "data-residency"; }; type: string & object | "policy"; }; orgId: string; } | - |
parameters.data? | { attributes: { name?: string; resources?: object[]; rule?: { in?: string[]; }; status?: "disabled" | string & object | "enabled"; type: string & object | "ip-allowlist" | "data-residency"; }; type: string & object | "policy"; } | - |
parameters.data.attributes? | { name?: string; resources?: object[]; rule?: { in?: string[]; }; status?: "disabled" | string & object | "enabled"; type: string & object | "ip-allowlist" | "data-residency"; } | Attributes of this object |
parameters.data.attributes.name? | string | Name of this Policy |
parameters.data.attributes.resources? | object[] | List of resources Policy is associated with |
parameters.data.attributes.rule? | { in?: string[]; } | Rule of the Policy |
parameters.data.attributes.rule.in? | string[] | - |
parameters.data.attributes.status? | "disabled" | string & object | "enabled" | Status of this Policy |
parameters.data.attributes.type? | string & object | "ip-allowlist" | "data-residency" | Type of this Policy |
parameters.data.type? | string & object | "policy" | Type of this object |
parameters.orgId? | string | Your organization has a unique ID. Find this ID in your Atlassian Administration URL or when you create your API key. |
options? | RequestOptions | - |
Returns
Promise<{ [key: string]: unknown; data?: { [key: string]: unknown; attributes: { [key: string]: unknown; createdAt?: string; id?: string; metadata?: unknown; name?: string; ownerId?: string; queryData?: unknown; resources?: object[]; rule?: | unknown[] | { [key: string]: unknown; in?: string[]; }; status?: "disabled" | string & object | "enabled"; type: | string & object | "ip-allowlist" | "data-residency" | "data-security" | "admin-notification-settings" | "generative-ai" | "hipaa" | "ugc-data-use-preferences" | "user-join-settings-default"; updatedAt?: string; }; id: string; links?: Record<string, any>; message?: unknown; type: string & object | "policy"; }; }>