Edits history of script submission #17208 for ' Create Archive Configuration (mezmo)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    /**
     * Create Archive Configuration
     * Use this method to configure archiving for an instance. Only one archiving configuration may exist at any time.
     */
    export async function main(auth: RT.Mezmo, body: Body) {
    	const url = new URL(`https://api.mezmo.com/v1/config/archiving`)
    
    	const response = await fetch(url, {
    		method: 'POST',
    		headers: {
    			'Content-Type': 'application/json',
    			Authorization: 'Token ' + auth.apiKey
    		},
    		body: JSON.stringify(body)
    	})
    	if (!response.ok) {
    		const text = await response.text()
    		throw new Error(`${response.status} ${text}`)
    	}
    	return await response.json()
    }
    
    /* eslint-disable */
    /**
     * This file was automatically generated by json-schema-to-typescript.
     * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
     * and run json-schema-to-typescript to regenerate this file.
     */
    
    export interface Body {
    	/**
    	 * Defines the type of notification channel. Valid values are: `email`, `webhook`, `slack`, and `pagerduty`
    	 */
    	integration?: string
    	/**
    	 * Name of the bucket.
    	 */
    	bucket?: string
    	/**
    	 * Private endpoint associated with the bucket.
    	 */
    	endpoint?: string
    	/**
    	 * API key that is needed to authenticate with the Cloud Object Storage service.
    	 */
    	apikey?: string
    	/**
    	 * CRN of the Cloud Object Storage instance ID where the bucket is available.
    	 */
    	resourceinstanceid?: string
    	/**
    	 * Account name
    	 */
    	accountname?: string
    	/**
    	 * Account key
    	 */
    	accountkey?: string
    	/**
    	 * Project ID
    	 */
    	projectid?: string
    	/**
    	 * Space
    	 */
    	space?: string
    	/**
    	 * Access key
    	 */
    	accesskey?: string
    	/**
    	 * Secret key
    	 */
    	secretkey?: string
    	/**
    	 * Auth URL
    	 */
    	authurl?: string
    	/**
    	 * Expires
    	 */
    	expires?: string
    	/**
    	 * Username
    	 */
    	username?: string
    	/**
    	 * Password provided in credentials for authorization
    	 */
    	password?: string
    	/**
    	 * Tenant name
    	 */
    	tenantname?: string
    	[k: string]: unknown
    }
    

    Submitted by hugo697 235 days ago