UNPKG

@microsoft/msgraph-beta-sdk-devicemanagement

Version:
85 lines 3.63 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 {ApprovePostRequestBody} */ export function createApprovePostRequestBodyFromDiscriminatorValue(parseNode) { return deserializeIntoApprovePostRequestBody; } /** * 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 {ApprovePostResponse} */ export function createApprovePostResponseFromDiscriminatorValue(parseNode) { return deserializeIntoApprovePostResponse; } /** * The deserialization information for the current model * @returns {Record<string, (node: ParseNode) => void>} */ export function deserializeIntoApprovePostRequestBody(approvePostRequestBody = {}) { return { "approvalSource": n => { approvePostRequestBody.approvalSource = n.getEnumValue(OperationApprovalSourceObject); }, "backingStoreEnabled": n => { approvePostRequestBody.backingStoreEnabled = true; }, "justification": n => { approvePostRequestBody.justification = n.getStringValue(); }, }; } /** * The deserialization information for the current model * @returns {Record<string, (node: ParseNode) => void>} */ export function deserializeIntoApprovePostResponse(approvePostResponse = {}) { return { "backingStoreEnabled": n => { approvePostResponse.backingStoreEnabled = true; }, "value": n => { approvePostResponse.value = n.getStringValue(); }, }; } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ export function serializeApprovePostRequestBody(writer, approvePostRequestBody = {}) { writer.writeEnumValue("approvalSource", approvePostRequestBody.approvalSource); writer.writeStringValue("justification", approvePostRequestBody.justification); writer.writeAdditionalData(approvePostRequestBody.additionalData); } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ export function serializeApprovePostResponse(writer, approvePostResponse = {}) { writer.writeStringValue("value", approvePostResponse.value); writer.writeAdditionalData(approvePostResponse.additionalData); } /** * Uri template for the request builder. */ export const ApproveRequestBuilderUriTemplate = "{+baseurl}/deviceManagement/operationApprovalRequests/{operationApprovalRequest%2Did}/approve"; /** * Metadata for all the requests in the request builder. */ export const ApproveRequestBuilderRequestsMetadata = { post: { uriTemplate: ApproveRequestBuilderUriTemplate, responseBodyContentType: "application/json", errorMappings: { XXX: createODataErrorFromDiscriminatorValue, }, adapterMethodName: "send", responseBodyFactory: createApprovePostResponseFromDiscriminatorValue, requestBodyContentType: "application/json", requestBodySerializer: serializeApprovePostRequestBody, requestInformationContentSetMethod: "setContentFromParsable", }, }; /* tslint:enable */ /* eslint-enable */ //# sourceMappingURL=index.js.map