@asposecloud/aspose-email-cloud
Version:
Aspose.Email Cloud Node.js SDK
134 lines (130 loc) • 3.59 kB
JavaScript
"use strict";
/*
* MIT License
* Copyright (c) 2018-2020 Aspose Pty Ltd
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContentTypeBuilder = exports.ContentType = void 0;
/**
* Represents a Content-Type header.
*/
class ContentType {
/**
* Represents a Content-Type header.
* @param boundary The boundary parameter included in the Content-Type header.
* @param charSet CharSet parameter.
* @param mediaType The internet media type.
* @param name Name parameter.
* @param parameters Full list of parameters
*/
constructor(boundary, charSet, mediaType, name, parameters) {
this.boundary = boundary;
this.charSet = charSet;
this.mediaType = mediaType;
this.name = name;
this.parameters = parameters;
}
/**
* Returns attribute type map
*/
static getAttributeTypeMap() {
return ContentType.attributeTypeMap;
}
}
exports.ContentType = ContentType;
/**
* Attribute type map
*/
ContentType.attributeTypeMap = [
{
name: "boundary",
baseName: "boundary",
type: "string",
},
{
name: "charSet",
baseName: "charSet",
type: "string",
},
{
name: "mediaType",
baseName: "mediaType",
type: "string",
},
{
name: "name",
baseName: "name",
type: "string",
},
{
name: "parameters",
baseName: "parameters",
type: "Array<ContentTypeParameter>",
}
];
/**
* ContentType model builder
*/
class ContentTypeBuilder {
constructor(model) {
this.model = model;
}
/**
* Build model.
*/
build() {
return this.model;
}
/**
* The boundary parameter included in the Content-Type header.
*/
boundary(boundary) {
this.model.boundary = boundary;
return this;
}
/**
* CharSet parameter.
*/
charSet(charSet) {
this.model.charSet = charSet;
return this;
}
/**
* The internet media type.
*/
mediaType(mediaType) {
this.model.mediaType = mediaType;
return this;
}
/**
* Name parameter.
*/
name(name) {
this.model.name = name;
return this;
}
/**
* Full list of parameters
*/
parameters(parameters) {
this.model.parameters = parameters;
return this;
}
}
exports.ContentTypeBuilder = ContentTypeBuilder;
//# sourceMappingURL=content-type.js.map