UNPKG

@microsoft/msgraph-beta-sdk-devicemanagement

Version:
103 lines 4.41 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} */ // @ts-ignore 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} */ // @ts-ignore export function createApprovePostResponseFromDiscriminatorValue(parseNode) { return deserializeIntoApprovePostResponse; } /** * The deserialization information for the current model * @param ApprovePostRequestBody The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore 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 * @param ApprovePostResponse The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoApprovePostResponse(approvePostResponse = {}) { return { "backingStoreEnabled": n => { approvePostResponse.backingStoreEnabled = true; }, "value": n => { approvePostResponse.value = n.getStringValue(); }, }; } /** * Serializes information the current object * @param ApprovePostRequestBody 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 serializeApprovePostRequestBody(writer, approvePostRequestBody = {}, isSerializingDerivedType = false) { if (!approvePostRequestBody || isSerializingDerivedType) { return; } writer.writeEnumValue("approvalSource", approvePostRequestBody.approvalSource); writer.writeStringValue("justification", approvePostRequestBody.justification); writer.writeAdditionalData(approvePostRequestBody.additionalData); } /** * Serializes information the current object * @param ApprovePostResponse 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 serializeApprovePostResponse(writer, approvePostResponse = {}, isSerializingDerivedType = false) { if (!approvePostResponse || isSerializingDerivedType) { return; } 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