import * as API from "@distilled.cloud/core/api"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-microsoft-graph). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; import { MicrosoftGraphServiceErrors } from "../errors.ts"; import { paginateCursor } from "../pagination.ts"; import { MicrosoftGraphProtocol, type MicrosoftGraphOpError, type MicrosoftGraphOpContext, } from "../protocol.ts"; import * as Retry from "../retry.ts"; import * as T from "../traits.ts"; // Schema table, filled on first reach (see __S at the end). const __s: any[] = []; export type { MicrosoftGraphOpError, MicrosoftGraphOpContext }; /** Span facts shared by every operation (com.distilled.telemetry#service). */ const TELEMETRY = { system: "microsoft-graph-api", responseHeaders: [ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" }, { header: "request-id", name: "http.response.header.request-id", transform: "list" }, ], prefix: "MicrosoftGraph", service: "AuthenticationMethodConfigurations", labels: "microsoft_graph", propagate: "w3c", } as const; export type AuthenticationMethodTargetType = "user" | "group" | "unknownFutureValue"; export interface ExcludeTarget { /** The object identifier of a Microsoft Entra user or group. */ id?: string | undefined; targetType?: AuthenticationMethodTargetType | (string & {}) | undefined; odataType?: string | undefined; } /** Groups of users that are excluded from a policy. */ export type CreateAuthenticationMethodConfigurationRequestExcludeTargetsList = Array; export type AuthenticationMethodState = "enabled" | "disabled"; export interface CreateAuthenticationMethodConfigurationRequest { /** The unique identifier for an entity. Read-only. */ id?: string | undefined; odataType?: string | undefined; /** Groups of users that are excluded from a policy. */ excludeTargets?: CreateAuthenticationMethodConfigurationRequestExcludeTargetsList | undefined; /** The state of the policy. The possible values are: enabled, disabled. */ state?: AuthenticationMethodState | (string & {}) | null | undefined; } /** Groups of users that are excluded from a policy. */ export type CreateAuthenticationMethodConfigurationResponseExcludeTargetsList = Array; export interface CreateAuthenticationMethodConfigurationResponse { /** The unique identifier for an entity. Read-only. */ id?: string | undefined; odataType?: string | undefined; /** Groups of users that are excluded from a policy. */ excludeTargets?: CreateAuthenticationMethodConfigurationResponseExcludeTargetsList | undefined; /** The state of the policy. The possible values are: enabled, disabled. */ state?: AuthenticationMethodState | null | undefined; } export interface DeleteAuthenticationMethodConfigurationRequest { /** The unique identifier of authenticationMethodConfiguration */ authenticationMethodConfigurationId: string; /** ETag */ ifMatch?: string | undefined; } export interface DeleteAuthenticationMethodConfigurationResponse {} export type GetAuthenticationMethodConfigurationRequestSelectList = Array; export type GetAuthenticationMethodConfigurationRequestExpandList = Array; export interface GetAuthenticationMethodConfigurationRequest { /** The unique identifier of authenticationMethodConfiguration */ authenticationMethodConfigurationId: string; /** Select properties to be returned */ select?: GetAuthenticationMethodConfigurationRequestSelectList | undefined; /** Expand related entities */ expand?: GetAuthenticationMethodConfigurationRequestExpandList | undefined; } /** Groups of users that are excluded from a policy. */ export type GetAuthenticationMethodConfigurationResponseExcludeTargetsList = Array; export interface GetAuthenticationMethodConfigurationResponse { /** The unique identifier for an entity. Read-only. */ id?: string | undefined; odataType?: string | undefined; /** Groups of users that are excluded from a policy. */ excludeTargets?: GetAuthenticationMethodConfigurationResponseExcludeTargetsList | undefined; /** The state of the policy. The possible values are: enabled, disabled. */ state?: AuthenticationMethodState | null | undefined; } export interface GetCountRequest { /** Search items by search phrases */ search?: string | undefined; /** Filter items by property values */ filter?: string | undefined; } export interface GetCountResponse {} export type ListAuthenticationMethodConfigurationRequestOrderbyList = Array; export type ListAuthenticationMethodConfigurationRequestSelectList = Array; export type ListAuthenticationMethodConfigurationRequestExpandList = Array; export interface ListAuthenticationMethodConfigurationRequest { /** Show only the first n items */ top?: number | undefined; /** Skip the first n items */ skip?: number | undefined; /** Search items by search phrases */ search?: string | undefined; /** Filter items by property values */ filter?: string | undefined; /** Include count of items */ count?: boolean | undefined; /** Order items by property values */ orderby?: ListAuthenticationMethodConfigurationRequestOrderbyList | undefined; /** Select properties to be returned */ select?: ListAuthenticationMethodConfigurationRequestSelectList | undefined; /** Expand related entities */ expand?: ListAuthenticationMethodConfigurationRequestExpandList | undefined; /** The `@odata.nextLink` of the previous page. When set, the request goes to this URL as-is and the other query members are ignored. */ nextLink?: string | undefined; } /** Groups of users that are excluded from a policy. */ export type AuthenticationMethodConfigurationExcludeTargetsList = Array; export interface AuthenticationMethodConfiguration { /** The unique identifier for an entity. Read-only. */ id?: string | undefined; odataType?: string | undefined; /** Groups of users that are excluded from a policy. */ excludeTargets?: AuthenticationMethodConfigurationExcludeTargetsList | undefined; /** The state of the policy. The possible values are: enabled, disabled. */ state?: AuthenticationMethodState | null | undefined; } export type ListAuthenticationMethodConfigurationResponseValueList = Array; export interface ListAuthenticationMethodConfigurationResponse { odataCount?: number | null | undefined; odataNextLink?: string | null | undefined; value: ListAuthenticationMethodConfigurationResponseValueList; } /** Groups of users that are excluded from a policy. */ export type UpdateAuthenticationMethodConfigurationRequestExcludeTargetsList = Array; export interface UpdateAuthenticationMethodConfigurationRequest { /** The unique identifier of authenticationMethodConfiguration */ authenticationMethodConfigurationId: string; /** The unique identifier for an entity. Read-only. */ id?: string | undefined; odataType?: string | undefined; /** Groups of users that are excluded from a policy. */ excludeTargets?: UpdateAuthenticationMethodConfigurationRequestExcludeTargetsList | undefined; /** The state of the policy. The possible values are: enabled, disabled. */ state?: AuthenticationMethodState | (string & {}) | null | undefined; } /** Groups of users that are excluded from a policy. */ export type UpdateAuthenticationMethodConfigurationResponseExcludeTargetsList = Array; export interface UpdateAuthenticationMethodConfigurationResponse { /** The unique identifier for an entity. Read-only. */ id?: string | undefined; odataType?: string | undefined; /** Groups of users that are excluded from a policy. */ excludeTargets?: UpdateAuthenticationMethodConfigurationResponseExcludeTargetsList | undefined; /** The state of the policy. The possible values are: enabled, disabled. */ state?: AuthenticationMethodState | null | undefined; } export type CreateAuthenticationMethodConfigurationError = MicrosoftGraphOpError; /** Add new entity to authenticationMethodConfigurations */ export const createAuthenticationMethodConfiguration: API.OperationMethod< CreateAuthenticationMethodConfigurationRequest, CreateAuthenticationMethodConfigurationResponse, CreateAuthenticationMethodConfigurationError, MicrosoftGraphOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(6, __c1, 2) as any as S.Schema, errors: [], serviceErrors: MicrosoftGraphServiceErrors, protocol: MicrosoftGraphProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateAuthenticationMethodConfiguration", })); export type DeleteAuthenticationMethodConfigurationError = MicrosoftGraphOpError; /** Delete entity from authenticationMethodConfigurations */ export const deleteAuthenticationMethodConfiguration: API.OperationMethod< DeleteAuthenticationMethodConfigurationRequest, DeleteAuthenticationMethodConfigurationResponse, DeleteAuthenticationMethodConfigurationError, MicrosoftGraphOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(8, __c2, 0) as any as S.Schema, output: __S(12, __c3, 0) as any as S.Schema, errors: [], serviceErrors: MicrosoftGraphServiceErrors, protocol: MicrosoftGraphProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteAuthenticationMethodConfiguration", })); export type GetAuthenticationMethodConfigurationError = MicrosoftGraphOpError; /** Get entity from authenticationMethodConfigurations by key */ export const getAuthenticationMethodConfiguration: API.OperationMethod< GetAuthenticationMethodConfigurationRequest, GetAuthenticationMethodConfigurationResponse, GetAuthenticationMethodConfigurationError, MicrosoftGraphOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(16, __c4, 0) as any as S.Schema, output: __S(6, __c1, 2) as any as S.Schema, errors: [], serviceErrors: MicrosoftGraphServiceErrors, protocol: MicrosoftGraphProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetAuthenticationMethodConfiguration", })); export type GetCountError = MicrosoftGraphOpError; /** Get the number of the resource */ export const getCount: API.OperationMethod< GetCountRequest, GetCountResponse, GetCountError, MicrosoftGraphOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(24, __c6, 0) as any as S.Schema, output: __S(12, __c3, 0) as any as S.Schema, errors: [], serviceErrors: MicrosoftGraphServiceErrors, protocol: MicrosoftGraphProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetCount", })); export type ListAuthenticationMethodConfigurationError = MicrosoftGraphOpError; /** Get entities from authenticationMethodConfigurations */ export const listAuthenticationMethodConfiguration: API.PaginatedOperationMethod< ListAuthenticationMethodConfigurationRequest, ListAuthenticationMethodConfigurationResponse, ListAuthenticationMethodConfigurationError, MicrosoftGraphOpContext, AuthenticationMethodConfiguration > = /*@__PURE__*/ API.makePaginated( () => ({ input: __S(28, __c7, 0) as any as S.Schema, output: __S(30, __c7, 2) as any as S.Schema, errors: [], serviceErrors: MicrosoftGraphServiceErrors, protocol: MicrosoftGraphProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListAuthenticationMethodConfiguration", pagination: { mode: "cursor", inputToken: "nextLink", outputToken: "odataNextLink", items: "value", pageSize: "top", } as const, }), paginateCursor, ) as any; export type UpdateAuthenticationMethodConfigurationError = MicrosoftGraphOpError; /** Update entity in authenticationMethodConfigurations */ export const updateAuthenticationMethodConfiguration: API.OperationMethod< UpdateAuthenticationMethodConfigurationRequest, UpdateAuthenticationMethodConfigurationResponse, UpdateAuthenticationMethodConfigurationError, MicrosoftGraphOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(32, __c8, 0) as any as S.Schema, output: __S(6, __c1, 2) as any as S.Schema, errors: [], serviceErrors: MicrosoftGraphServiceErrors, protocol: MicrosoftGraphProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateAuthenticationMethodConfiguration", })); // Schema builders: each runs one schema initializer, on that schema's first use. function __c0(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.optional(S.String), odataType: S.optional(S.String.pipe(T.Body("@odata.type"))), excludeTargets: S.optional(__S(5, __c1, 1)), state: S.optional(S.NullOr(S.String)), }).pipe(T.Http({ method: "POST", uri: "/authenticationMethodConfigurations", code: 200 })), ).annotate({ identifier: "CreateAuthenticationMethodConfigurationRequest" }); } } function __c1(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.optional(S.String), targetType: S.optional(S.String), odataType: S.optional(S.String.pipe(T.Body("@odata.type"))), }), ).annotate({ identifier: "ExcludeTarget" }); case 1: return S.Array(__S(4, __c1, 0)); case 2: return S.suspend(() => S.Struct({ id: S.optional(S.String), odataType: S.optional(S.String.pipe(T.Body("@odata.type"))), excludeTargets: S.optional(__S(5, __c1, 1)), state: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "CreateAuthenticationMethodConfigurationResponse" }); } } function __c2(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ authenticationMethodConfigurationId: S.String.pipe(T.Label()), ifMatch: S.optional(S.String.pipe(T.Header("If-Match"))), }).pipe( T.Http({ method: "DELETE", uri: "/authenticationMethodConfigurations/{authenticationMethodConfigurationId}", code: 200, }), ), ).annotate({ identifier: "DeleteAuthenticationMethodConfigurationRequest" }); } } function __c3(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({})).annotate({ identifier: "DeleteAuthenticationMethodConfigurationResponse", }); } } function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ authenticationMethodConfigurationId: S.String.pipe(T.Label()), select: S.optional(__S(20, __c5, 0).pipe(T.Query("$select"), T.CommaDelimited({}))), expand: S.optional(__S(20, __c5, 0).pipe(T.Query("$expand"), T.CommaDelimited({}))), }).pipe( T.Http({ method: "GET", uri: "/authenticationMethodConfigurations/{authenticationMethodConfigurationId}", code: 200, }), ), ).annotate({ identifier: "GetAuthenticationMethodConfigurationRequest" }); } } function __c5(j: number): any { switch (j) { case 0: return S.Array(S.String); } } function __c6(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ search: S.optional(S.String.pipe(T.Query("$search"))), filter: S.optional(S.String.pipe(T.Query("$filter"))), }).pipe( T.Http({ method: "GET", uri: "/authenticationMethodConfigurations/$count", code: 200 }), ), ).annotate({ identifier: "GetCountRequest" }); } } function __c7(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ top: S.optional(S.Number.pipe(T.Query("$top"))), skip: S.optional(S.Number.pipe(T.Query("$skip"))), search: S.optional(S.String.pipe(T.Query("$search"))), filter: S.optional(S.String.pipe(T.Query("$filter"))), count: S.optional(S.Boolean.pipe(T.Query("$count"))), orderby: S.optional(__S(20, __c5, 0).pipe(T.Query("$orderby"), T.CommaDelimited({}))), select: S.optional(__S(20, __c5, 0).pipe(T.Query("$select"), T.CommaDelimited({}))), expand: S.optional(__S(20, __c5, 0).pipe(T.Query("$expand"), T.CommaDelimited({}))), nextLink: S.optional(S.String), }).pipe(T.Http({ method: "GET", uri: "/authenticationMethodConfigurations", code: 200 })), ).annotate({ identifier: "ListAuthenticationMethodConfigurationRequest" }); case 1: return S.Array(__S(6, __c1, 2)); case 2: return S.suspend(() => S.Struct({ odataCount: S.optional(S.NullOr(S.Number).pipe(T.Body("@odata.count"))), odataNextLink: S.optional(S.NullOr(S.String).pipe(T.Body("@odata.nextLink"))), value: __S(29, __c7, 1), }), ).annotate({ identifier: "ListAuthenticationMethodConfigurationResponse" }); } } function __c8(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ authenticationMethodConfigurationId: S.String.pipe(T.Label()), id: S.optional(S.String), odataType: S.optional(S.String.pipe(T.Body("@odata.type"))), excludeTargets: S.optional(__S(5, __c1, 1)), state: S.optional(S.NullOr(S.String)), }).pipe( T.Http({ method: "PATCH", uri: "/authenticationMethodConfigurations/{authenticationMethodConfigurationId}", code: 200, }), ), ).annotate({ identifier: "UpdateAuthenticationMethodConfigurationRequest" }); } } // Schema table: entry i is schema j of builder f, made on first reach. function __S(i: number, f: (j: number) => unknown, j: number): any { return (__s[i] ??= __L.at(f, j)); }