UNPKG

@microsoft/msgraph-beta-sdk-devicemanagement

Version:
103 lines 4.67 kB
/* tslint:disable */ /* eslint-disable */ // Generated by Microsoft Kiota // @ts-ignore import { OperationApprovalSourceObject } from '@microsoft/msgraph-beta-sdk/models/index.js'; // @ts-ignore import { createODataErrorFromDiscriminatorValue } from '@microsoft/msgraph-beta-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 {CancelApprovalPostRequestBody} */ // @ts-ignore export function createCancelApprovalPostRequestBodyFromDiscriminatorValue(parseNode) { return deserializeIntoCancelApprovalPostRequestBody; } /** * 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 {CancelApprovalPostResponse} */ // @ts-ignore export function createCancelApprovalPostResponseFromDiscriminatorValue(parseNode) { return deserializeIntoCancelApprovalPostResponse; } /** * The deserialization information for the current model * @param CancelApprovalPostRequestBody The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoCancelApprovalPostRequestBody(cancelApprovalPostRequestBody = {}) { return { "approvalSource": n => { cancelApprovalPostRequestBody.approvalSource = n.getEnumValue(OperationApprovalSourceObject); }, "backingStoreEnabled": n => { cancelApprovalPostRequestBody.backingStoreEnabled = true; }, "justification": n => { cancelApprovalPostRequestBody.justification = n.getStringValue(); }, }; } /** * The deserialization information for the current model * @param CancelApprovalPostResponse The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoCancelApprovalPostResponse(cancelApprovalPostResponse = {}) { return { "backingStoreEnabled": n => { cancelApprovalPostResponse.backingStoreEnabled = true; }, "value": n => { cancelApprovalPostResponse.value = n.getStringValue(); }, }; } /** * Serializes information the current object * @param CancelApprovalPostRequestBody 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 serializeCancelApprovalPostRequestBody(writer, cancelApprovalPostRequestBody = {}, isSerializingDerivedType = false) { if (!cancelApprovalPostRequestBody || isSerializingDerivedType) { return; } writer.writeEnumValue("approvalSource", cancelApprovalPostRequestBody.approvalSource); writer.writeStringValue("justification", cancelApprovalPostRequestBody.justification); writer.writeAdditionalData(cancelApprovalPostRequestBody.additionalData); } /** * Serializes information the current object * @param CancelApprovalPostResponse 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 serializeCancelApprovalPostResponse(writer, cancelApprovalPostResponse = {}, isSerializingDerivedType = false) { if (!cancelApprovalPostResponse || isSerializingDerivedType) { return; } writer.writeStringValue("value", cancelApprovalPostResponse.value); writer.writeAdditionalData(cancelApprovalPostResponse.additionalData); } /** * Uri template for the request builder. */ export const CancelApprovalRequestBuilderUriTemplate = "{+baseurl}/deviceManagement/operationApprovalRequests/{operationApprovalRequest%2Did}/cancelApproval"; /** * Metadata for all the requests in the request builder. */ export const CancelApprovalRequestBuilderRequestsMetadata = { post: { uriTemplate: CancelApprovalRequestBuilderUriTemplate, responseBodyContentType: "application/json", errorMappings: { XXX: createODataErrorFromDiscriminatorValue, }, adapterMethodName: "send", responseBodyFactory: createCancelApprovalPostResponseFromDiscriminatorValue, requestBodyContentType: "application/json", requestBodySerializer: serializeCancelApprovalPostRequestBody, requestInformationContentSetMethod: "setContentFromParsable", }, }; /* tslint:enable */ /* eslint-enable */ //# sourceMappingURL=index.js.map