|
| 1 | +/* tslint:disable */ |
| 2 | +/* eslint-disable */ |
| 3 | +// Generated by Microsoft Kiota |
| 4 | +// @ts-ignore |
| 5 | +import { createTeamworkUserIdentityFromDiscriminatorValue, serializeTeamworkUserIdentity, type TeamworkUserIdentity } from '@microsoft/msgraph-sdk/models/index.js'; |
| 6 | +// @ts-ignore |
| 7 | +import { createODataErrorFromDiscriminatorValue, type ODataError } from '@microsoft/msgraph-sdk/models/oDataErrors/index.js'; |
| 8 | +// @ts-ignore |
| 9 | +import { type AdditionalDataHolder, type BackedModel, type BackingStore, type BaseRequestBuilder, type Parsable, type ParsableFactory, type ParseNode, type RequestConfiguration, type RequestInformation, type RequestsMetadata, type SerializationWriter } from '@microsoft/kiota-abstractions'; |
| 10 | + |
| 11 | +/** |
| 12 | + * Creates a new instance of the appropriate class based on discriminator value |
| 13 | + * @param parseNode The parse node to use to read the discriminator value and create the object |
| 14 | + * @returns {RemoveAllAccessForUserPostRequestBody} |
| 15 | + */ |
| 16 | +// @ts-ignore |
| 17 | +export function createRemoveAllAccessForUserPostRequestBodyFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) { |
| 18 | + return deserializeIntoRemoveAllAccessForUserPostRequestBody; |
| 19 | +} |
| 20 | +/** |
| 21 | + * The deserialization information for the current model |
| 22 | + * @param RemoveAllAccessForUserPostRequestBody The instance to deserialize into. |
| 23 | + * @returns {Record<string, (node: ParseNode) => void>} |
| 24 | + */ |
| 25 | +// @ts-ignore |
| 26 | +export function deserializeIntoRemoveAllAccessForUserPostRequestBody(removeAllAccessForUserPostRequestBody: Partial<RemoveAllAccessForUserPostRequestBody> | undefined = {}) : Record<string, (node: ParseNode) => void> { |
| 27 | + return { |
| 28 | + "backingStoreEnabled": n => { removeAllAccessForUserPostRequestBody.backingStoreEnabled = true; }, |
| 29 | + "user": n => { removeAllAccessForUserPostRequestBody.user = n.getObjectValue<TeamworkUserIdentity>(createTeamworkUserIdentityFromDiscriminatorValue); }, |
| 30 | + } |
| 31 | +} |
| 32 | +export interface RemoveAllAccessForUserPostRequestBody extends AdditionalDataHolder, BackedModel, Parsable { |
| 33 | + /** |
| 34 | + * Stores model information. |
| 35 | + */ |
| 36 | + backingStoreEnabled?: boolean | null; |
| 37 | + /** |
| 38 | + * The user property |
| 39 | + */ |
| 40 | + user?: TeamworkUserIdentity | null; |
| 41 | +} |
| 42 | +/** |
| 43 | + * Provides operations to call the removeAllAccessForUser method. |
| 44 | + */ |
| 45 | +export interface RemoveAllAccessForUserRequestBuilder extends BaseRequestBuilder<RemoveAllAccessForUserRequestBuilder> { |
| 46 | + /** |
| 47 | + * Remove access to a chat for a user. |
| 48 | + * @param body The request body |
| 49 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 50 | + * @throws {ODataError} error when the service returns a 4XX or 5XX status code |
| 51 | + * @see {@link https://learn.microsoft.com/graph/api/chat-removeallaccessforuser?view=graph-rest-1.0|Find more info here} |
| 52 | + */ |
| 53 | + post(body: RemoveAllAccessForUserPostRequestBody, requestConfiguration?: RequestConfiguration<object> | undefined) : Promise<void>; |
| 54 | + /** |
| 55 | + * Remove access to a chat for a user. |
| 56 | + * @param body The request body |
| 57 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 58 | + * @returns {RequestInformation} |
| 59 | + */ |
| 60 | + toPostRequestInformation(body: RemoveAllAccessForUserPostRequestBody, requestConfiguration?: RequestConfiguration<object> | undefined) : RequestInformation; |
| 61 | +} |
| 62 | +/** |
| 63 | + * Serializes information the current object |
| 64 | + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. |
| 65 | + * @param RemoveAllAccessForUserPostRequestBody The instance to serialize from. |
| 66 | + * @param writer Serialization writer to use to serialize this model |
| 67 | + */ |
| 68 | +// @ts-ignore |
| 69 | +export function serializeRemoveAllAccessForUserPostRequestBody(writer: SerializationWriter, removeAllAccessForUserPostRequestBody: Partial<RemoveAllAccessForUserPostRequestBody> | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { |
| 70 | + if (!removeAllAccessForUserPostRequestBody || isSerializingDerivedType) { return; } |
| 71 | + writer.writeObjectValue<TeamworkUserIdentity>("user", removeAllAccessForUserPostRequestBody.user, serializeTeamworkUserIdentity); |
| 72 | + writer.writeAdditionalData(removeAllAccessForUserPostRequestBody.additionalData); |
| 73 | +} |
| 74 | +/** |
| 75 | + * Uri template for the request builder. |
| 76 | + */ |
| 77 | +export const RemoveAllAccessForUserRequestBuilderUriTemplate = "{+baseurl}/chats/{chat%2Did}/removeAllAccessForUser"; |
| 78 | +/** |
| 79 | + * Metadata for all the requests in the request builder. |
| 80 | + */ |
| 81 | +export const RemoveAllAccessForUserRequestBuilderRequestsMetadata: RequestsMetadata = { |
| 82 | + post: { |
| 83 | + uriTemplate: RemoveAllAccessForUserRequestBuilderUriTemplate, |
| 84 | + responseBodyContentType: "application/json", |
| 85 | + errorMappings: { |
| 86 | + XXX: createODataErrorFromDiscriminatorValue as ParsableFactory<Parsable>, |
| 87 | + }, |
| 88 | + adapterMethodName: "sendNoResponseContent", |
| 89 | + requestBodyContentType: "application/json", |
| 90 | + requestBodySerializer: serializeRemoveAllAccessForUserPostRequestBody, |
| 91 | + requestInformationContentSetMethod: "setContentFromParsable", |
| 92 | + }, |
| 93 | +}; |
| 94 | +/* tslint:enable */ |
| 95 | +/* eslint-enable */ |
0 commit comments