Create a new item in the editor session file tree. No operation is done if the file or directory already exists

Use a bare-bones client and the command you need to make an API call.

import { Apiv2Client, PutEditorFileCommand } from "@codegrade/apiv2-client"; // ES Modules import
// const { Apiv2Client, PutEditorFileCommand } = require("@codegrade/apiv2-client"); // CommonJS import
const client = new Apiv2Client(config);
const input = { // PutEditorFileRequest
editorSessionId: "STRING_VALUE", // required
path: "STRING_VALUE", // required
fileType: { // InputFileType Union: only one key present
directory: {},
regular: { // InputRegularFileType
content: "STRING_VALUE",
},
},
};
const command = new PutEditorFileCommand(input);
const response = await client.send(command);
// { // PutEditorFileResponse
// file: { // OutputEditorFile
// editorSessionId: "STRING_VALUE", // required
// path: "STRING_VALUE", // required
// assignmentId: "STRING_VALUE", // required
// fileType: { // EditorFileType Union: only one key present
// directory: { // OutputEditorDirectoryType
// children: [ // EditorFileList // required
// {// Union: only one key present
// directory: {
// children: [ // required
// "<EditorFileType>",
// ],
// },
// regular: { // OuptutRegularFileType Union: only one key present
// text: { // OutputRegularTextFileType
// documentId: "STRING_VALUE", // required
// },
// binary: {},
// quiz: { // OutputRegularQuizFileType
// documentId: "STRING_VALUE", // required
// },
// notebook: { // OutputJupyterNotebookFileType
// documentId: "STRING_VALUE", // required
// },
// },
// },
// ],
// },
// regular: {// Union: only one key present
// text: {
// documentId: "STRING_VALUE", // required
// },
// binary: {},
// quiz: {
// documentId: "STRING_VALUE", // required
// },
// notebook: {
// documentId: "STRING_VALUE", // required
// },
// },
// },
// },
// };

PutEditorFileCommandInput

InternalServerError (server fault) An internal failure at the fault of the server.

BadRequestError (client fault) An error at the fault of the client sending invalid input.

NotFoundError (client fault) An error due to the client attempting to access a missing resource.

NotAuthorizedError (client fault) An error due to the client not being authorized to access the resource.

NotAuthenticatedError (client fault) An error due to the client not being authenticated.

ValidationError (client fault) A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.

Apiv2ServiceException

Base exception class for all service exceptions from Apiv2 service.

Hierarchy

Constructors

  • Parameters

    Returns PutEditorFileCommand

  • Parameters

    Returns PutEditorFileCommand

Properties

middlewareStack: MiddlewareStack<
    PutEditorFileCommandInput,
    PutEditorFileCommandOutput,
>
schema?: OperationSchema

This should be OperationSchema from @smithy/types, but would create problems with the client transform type adaptors.

__types: {
    api: { input: PutEditorFileRequest; output: PutEditorFileResponse };
    sdk: {
        input: PutEditorFileCommandInput;
        output: PutEditorFileCommandOutput;
    };
}

type navigation helper, not in runtime.

Methods

  • Internal

    Parameters

    • clientStack: MiddlewareStack<any, any>
    • configuration: { logger: Logger; requestHandler: RequestHandler<any, any, any> }
    • options: any
    • __namedParameters: ResolveMiddlewareContextArgs

    Returns InitializeHandler<any, PutEditorFileCommandOutput>

  • Returns EndpointParameterInstructions