rawSetTemplateAttachmentMultiWithHttpInfo method

Future<Response> rawSetTemplateAttachmentMultiWithHttpInfo(
  1. String formTemplateId,
  2. String attachment
)

Update a form template's layout

Note: This method returns the HTTP Response.

Parameters:

  • String formTemplateId (required):

  • String attachment (required):

Implementation

Future<Response> rawSetTemplateAttachmentMultiWithHttpInfo(String formTemplateId, String attachment,) async {
  // ignore: prefer_const_declarations
  final path = r'/rest/v1/form/template/{formTemplateId}/attachment/multipart'.replaceAll('{formTemplateId}', formTemplateId);

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const authNames = <String>[r'basicSchema'];
  const contentTypes = <String>['multipart/form-data'];

  bool hasFields = false;
  final mp = MultipartRequest('PUT', Uri.parse(path));
  if (attachment != null) {
    hasFields = true;
    mp.fields[r'attachment'] = parameterToString(attachment);
  }
  if (hasFields) {
    postBody = mp;
  }

  return apiClient.invokeAPI(
    path,
    'PUT',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
    authNames,
  );
}