UNPKG

@microsoft/msgraph-sdk-shares

Version:
100 lines 4.68 kB
/* tslint:disable */ /* eslint-disable */ // Generated by Microsoft Kiota // @ts-ignore import { createDriveRecipientFromDiscriminatorValue, createPermissionFromDiscriminatorValue, deserializeIntoBaseCollectionPaginationCountResponse, serializeBaseCollectionPaginationCountResponse, serializeDriveRecipient, serializePermission } from '@microsoft/msgraph-sdk/models/index.js'; // @ts-ignore import { createODataErrorFromDiscriminatorValue } from '@microsoft/msgraph-sdk/models/oDataErrors/index.js'; /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object * @returns {GrantPostRequestBody} */ // @ts-ignore export function createGrantPostRequestBodyFromDiscriminatorValue(parseNode) { return deserializeIntoGrantPostRequestBody; } /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object * @returns {GrantPostResponse} */ // @ts-ignore export function createGrantPostResponseFromDiscriminatorValue(parseNode) { return deserializeIntoGrantPostResponse; } /** * The deserialization information for the current model * @param GrantPostRequestBody The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoGrantPostRequestBody(grantPostRequestBody = {}) { return { "backingStoreEnabled": n => { grantPostRequestBody.backingStoreEnabled = true; }, "recipients": n => { grantPostRequestBody.recipients = n.getCollectionOfObjectValues(createDriveRecipientFromDiscriminatorValue); }, "roles": n => { grantPostRequestBody.roles = n.getCollectionOfPrimitiveValues(); }, }; } /** * The deserialization information for the current model * @param GrantPostResponse The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoGrantPostResponse(grantPostResponse = {}) { return Object.assign(Object.assign({}, deserializeIntoBaseCollectionPaginationCountResponse(grantPostResponse)), { "value": n => { grantPostResponse.value = n.getCollectionOfObjectValues(createPermissionFromDiscriminatorValue); } }); } /** * Serializes information the current object * @param GrantPostRequestBody The instance to serialize from. * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeGrantPostRequestBody(writer, grantPostRequestBody = {}, isSerializingDerivedType = false) { if (!grantPostRequestBody || isSerializingDerivedType) { return; } writer.writeCollectionOfObjectValues("recipients", grantPostRequestBody.recipients, serializeDriveRecipient); writer.writeCollectionOfPrimitiveValues("roles", grantPostRequestBody.roles); writer.writeAdditionalData(grantPostRequestBody.additionalData); } /** * Serializes information the current object * @param GrantPostResponse The instance to serialize from. * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeGrantPostResponse(writer, grantPostResponse = {}, isSerializingDerivedType = false) { if (!grantPostResponse || isSerializingDerivedType) { return; } serializeBaseCollectionPaginationCountResponse(writer, grantPostResponse, isSerializingDerivedType); writer.writeCollectionOfObjectValues("value", grantPostResponse.value, serializePermission); } /** * Uri template for the request builder. */ export const GrantRequestBuilderUriTemplate = "{+baseurl}/shares/{sharedDriveItem%2Did}/permission/grant"; /** * Metadata for all the requests in the request builder. */ export const GrantRequestBuilderRequestsMetadata = { post: { uriTemplate: GrantRequestBuilderUriTemplate, responseBodyContentType: "application/json", errorMappings: { XXX: createODataErrorFromDiscriminatorValue, }, adapterMethodName: "send", responseBodyFactory: createGrantPostResponseFromDiscriminatorValue, requestBodyContentType: "application/json", requestBodySerializer: serializeGrantPostRequestBody, requestInformationContentSetMethod: "setContentFromParsable", }, }; /* tslint:enable */ /* eslint-enable */ //# sourceMappingURL=index.js.map