Skip to content

Commit 8daed62

Browse files
Fixes TemplateEdit endpoint spec
1 parent a937871 commit 8daed62

68 files changed

Lines changed: 3608 additions & 589 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/TemplateEditExample.cs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Text.Json;
5+
6+
using Dropbox.Sign.Api;
7+
using Dropbox.Sign.Client;
8+
using Dropbox.Sign.Model;
9+
10+
namespace Dropbox.SignSandbox;
11+
12+
public class TemplateEditExample
13+
{
14+
public static void Run()
15+
{
16+
var config = new Configuration();
17+
config.Username = "YOUR_API_KEY";
18+
// config.AccessToken = "YOUR_ACCESS_TOKEN";
19+
20+
var templateEditRequest = new TemplateEditRequest(
21+
ccRoles: [
22+
"Role 1",
23+
"Role 2",
24+
]
25+
);
26+
27+
try
28+
{
29+
var response = new TemplateApi(config).TemplateEdit(
30+
templateId: "f57db65d3f933b5316d398057a36176831451a35",
31+
templateEditRequest: templateEditRequest
32+
);
33+
34+
Console.WriteLine(response);
35+
}
36+
catch (ApiException e)
37+
{
38+
Console.WriteLine("Exception when calling TemplateApi#TemplateEdit: " + e.Message);
39+
Console.WriteLine("Status Code: " + e.ErrorCode);
40+
Console.WriteLine(e.StackTrace);
41+
}
42+
}
43+
}

examples/TemplateEditExample.java

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package com.dropbox.sign_sandbox;
2+
3+
import com.dropbox.sign.ApiException;
4+
import com.dropbox.sign.Configuration;
5+
import com.dropbox.sign.api.*;
6+
import com.dropbox.sign.auth.*;
7+
import com.dropbox.sign.JSON;
8+
import com.dropbox.sign.model.*;
9+
10+
import java.io.File;
11+
import java.math.BigDecimal;
12+
import java.time.LocalDate;
13+
import java.time.OffsetDateTime;
14+
import java.util.ArrayList;
15+
import java.util.List;
16+
import java.util.Map;
17+
18+
public class TemplateEditExample
19+
{
20+
public static void main(String[] args)
21+
{
22+
var config = Configuration.getDefaultApiClient();
23+
((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY");
24+
// ((HttpBearerAuth) config.getAuthentication("oauth2")).setBearerToken("YOUR_ACCESS_TOKEN");
25+
26+
var templateEditRequest = new TemplateEditRequest();
27+
templateEditRequest.ccRoles(List.of (
28+
"Role 1",
29+
"Role 2"
30+
));
31+
32+
try
33+
{
34+
var response = new TemplateApi(config).templateEdit(
35+
"f57db65d3f933b5316d398057a36176831451a35", // templateId
36+
templateEditRequest
37+
);
38+
39+
System.out.println(response);
40+
} catch (ApiException e) {
41+
System.err.println("Exception when calling TemplateApi#templateEdit");
42+
System.err.println("Status code: " + e.getCode());
43+
System.err.println("Reason: " + e.getResponseBody());
44+
System.err.println("Response headers: " + e.getResponseHeaders());
45+
e.printStackTrace();
46+
}
47+
}
48+
}

examples/TemplateEditExample.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace Dropbox\SignSandbox;
4+
5+
require_once __DIR__ . '/../vendor/autoload.php';
6+
7+
use SplFileObject;
8+
use Dropbox;
9+
10+
$config = Dropbox\Sign\Configuration::getDefaultConfiguration();
11+
$config->setUsername("YOUR_API_KEY");
12+
// $config->setAccessToken("YOUR_ACCESS_TOKEN");
13+
14+
$template_edit_request = (new Dropbox\Sign\Model\TemplateEditRequest())
15+
->setCcRoles([
16+
"Role 1",
17+
"Role 2",
18+
]);
19+
20+
try {
21+
$response = (new Dropbox\Sign\Api\TemplateApi(config: $config))->templateEdit(
22+
template_id: "f57db65d3f933b5316d398057a36176831451a35",
23+
template_edit_request: $template_edit_request,
24+
);
25+
26+
print_r($response);
27+
} catch (Dropbox\Sign\ApiException $e) {
28+
echo "Exception when calling TemplateApi#templateEdit: {$e->getMessage()}";
29+
}

examples/TemplateEditExample.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import json
2+
from datetime import date, datetime
3+
from pprint import pprint
4+
5+
from dropbox_sign import ApiClient, ApiException, Configuration, api, models
6+
7+
configuration = Configuration(
8+
username="YOUR_API_KEY",
9+
# access_token="YOUR_ACCESS_TOKEN",
10+
)
11+
12+
with ApiClient(configuration) as api_client:
13+
template_edit_request = models.TemplateEditRequest(
14+
cc_roles=[
15+
"Role 1",
16+
"Role 2",
17+
],
18+
)
19+
20+
try:
21+
response = api.TemplateApi(api_client).template_edit(
22+
template_id="f57db65d3f933b5316d398057a36176831451a35",
23+
template_edit_request=template_edit_request,
24+
)
25+
26+
pprint(response)
27+
except ApiException as e:
28+
print("Exception when calling TemplateApi#template_edit: %s\n" % e)

examples/TemplateEditExample.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
require "json"
2+
require "dropbox-sign"
3+
4+
Dropbox::Sign.configure do |config|
5+
config.username = "YOUR_API_KEY"
6+
# config.access_token = "YOUR_ACCESS_TOKEN"
7+
end
8+
9+
template_edit_request = Dropbox::Sign::TemplateEditRequest.new
10+
template_edit_request.cc_roles = [
11+
"Role 1",
12+
"Role 2",
13+
]
14+
15+
begin
16+
response = Dropbox::Sign::TemplateApi.new.template_edit(
17+
"f57db65d3f933b5316d398057a36176831451a35", # template_id
18+
template_edit_request,
19+
)
20+
21+
p response
22+
rescue Dropbox::Sign::ApiError => e
23+
puts "Exception when calling TemplateApi#template_edit: #{e}"
24+
end

examples/TemplateEditExample.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import * as fs from 'fs';
2+
import api from "@dropbox/sign"
3+
import models from "@dropbox/sign"
4+
5+
const apiCaller = new api.TemplateApi();
6+
apiCaller.username = "YOUR_API_KEY";
7+
// apiCaller.accessToken = "YOUR_ACCESS_TOKEN";
8+
9+
const templateEditRequest: models.TemplateEditRequest = {
10+
ccRoles: [
11+
"Role 1",
12+
"Role 2",
13+
],
14+
};
15+
16+
apiCaller.templateEdit(
17+
"f57db65d3f933b5316d398057a36176831451a35", // templateId
18+
templateEditRequest,
19+
).then(response => {
20+
console.log(response.body);
21+
}).catch(error => {
22+
console.log("Exception when calling TemplateApi#templateEdit:");
23+
console.log(error.body);
24+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"cc_roles": ["Role 1", "Role 2"]
3+
}

openapi-raw.yaml

Lines changed: 126 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6513,6 +6513,117 @@ paths:
65136513
seo:
65146514
title: '_t__TemplateDelete::SEO::TITLE'
65156515
description: '_t__TemplateDelete::SEO::DESCRIPTION'
6516+
'/template/edit/{template_id}':
6517+
post:
6518+
tags:
6519+
- Template
6520+
summary: '_t__TemplateEdit::SUMMARY'
6521+
description: '_t__TemplateEdit::DESCRIPTION'
6522+
operationId: templateEdit
6523+
parameters:
6524+
-
6525+
name: template_id
6526+
in: path
6527+
description: '_t__TemplateEdit::TEMPLATE_ID'
6528+
required: true
6529+
schema:
6530+
type: string
6531+
example: f57db65d3f933b5316d398057a36176831451a35
6532+
requestBody:
6533+
required: true
6534+
content:
6535+
application/json:
6536+
schema:
6537+
$ref: '#/components/schemas/TemplateEditRequest'
6538+
examples:
6539+
example:
6540+
$ref: '#/components/examples/TemplateEditRequest'
6541+
responses:
6542+
'200':
6543+
description: 'successful operation'
6544+
headers:
6545+
X-RateLimit-Limit:
6546+
$ref: '#/components/headers/X-RateLimit-Limit'
6547+
X-RateLimit-Remaining:
6548+
$ref: '#/components/headers/X-RateLimit-Remaining'
6549+
X-Ratelimit-Reset:
6550+
$ref: '#/components/headers/X-Ratelimit-Reset'
6551+
content:
6552+
application/json:
6553+
schema:
6554+
$ref: '#/components/schemas/TemplateGetResponse'
6555+
examples:
6556+
example:
6557+
$ref: '#/components/examples/TemplateGetResponse'
6558+
4XX:
6559+
description: failed_operation
6560+
content:
6561+
application/json:
6562+
schema:
6563+
$ref: '#/components/schemas/ErrorResponse'
6564+
examples:
6565+
400_example:
6566+
$ref: '#/components/examples/Error400Response'
6567+
401_example:
6568+
$ref: '#/components/examples/Error401Response'
6569+
402_example:
6570+
$ref: '#/components/examples/Error402Response'
6571+
403_example:
6572+
$ref: '#/components/examples/Error403Response'
6573+
429_example:
6574+
$ref: '#/components/examples/Error429Response'
6575+
404_example:
6576+
$ref: '#/components/examples/Error404Response'
6577+
409_example:
6578+
$ref: '#/components/examples/Error409Response'
6579+
4XX_example:
6580+
$ref: '#/components/examples/Error4XXResponse'
6581+
security:
6582+
-
6583+
api_key: []
6584+
-
6585+
oauth2:
6586+
- template_access
6587+
x-codeSamples:
6588+
-
6589+
lang: PHP
6590+
label: PHP
6591+
source:
6592+
$ref: examples/TemplateEditExample.php
6593+
-
6594+
lang: 'C#'
6595+
label: 'C#'
6596+
source:
6597+
$ref: examples/TemplateEditExample.cs
6598+
-
6599+
lang: TypeScript
6600+
label: TypeScript
6601+
source:
6602+
$ref: examples/TemplateEditExample.ts
6603+
-
6604+
lang: Java
6605+
label: Java
6606+
source:
6607+
$ref: examples/TemplateEditExample.java
6608+
-
6609+
lang: Ruby
6610+
label: Ruby
6611+
source:
6612+
$ref: examples/TemplateEditExample.rb
6613+
-
6614+
lang: Python
6615+
label: Python
6616+
source:
6617+
$ref: examples/TemplateEditExample.py
6618+
-
6619+
lang: cURL
6620+
label: cURL
6621+
source:
6622+
$ref: examples/TemplateEditExample.sh
6623+
x-meta:
6624+
seo:
6625+
title: '_t__TemplateEdit::SEO::TITLE'
6626+
description: '_t__TemplateEdit::SEO::DESCRIPTION'
65166627
'/template/files/{template_id}':
65176628
get:
65186629
tags:
@@ -10179,6 +10290,17 @@ components:
1017910290
type: boolean
1018010291
default: false
1018110292
type: object
10293+
TemplateEditRequest:
10294+
properties:
10295+
cc_roles:
10296+
description: '_t__TemplateEdit::CC_ROLES'
10297+
type: array
10298+
items:
10299+
type: string
10300+
allow_form_view:
10301+
description: '_t__TemplateEdit::ALLOW_FORM_VIEW'
10302+
type: boolean
10303+
type: object
1018210304
TemplateRemoveUserRequest:
1018310305
properties:
1018410306
account_id:
@@ -12767,14 +12889,6 @@ components:
1276712889
$ref: '#/components/schemas/WarningResponse'
1276812890
type: object
1276912891
x-internal-class: true
12770-
TemplateEditResponse:
12771-
required:
12772-
- template_id
12773-
properties:
12774-
template_id:
12775-
description: '_t__TemplateResponse::TEMPLATE_ID'
12776-
type: string
12777-
type: object
1277812892
TemplateGetResponse:
1277912893
required:
1278012894
- template
@@ -13098,6 +13212,10 @@ components:
1309813212
summary: 'Form Fields Per Document and Rules Example'
1309913213
value:
1310013214
$ref: examples/json/TemplateCreateEmbeddedDraftRequestFormFieldRules.json
13215+
TemplateEditRequest:
13216+
summary: 'Default Example'
13217+
value:
13218+
$ref: examples/json/TemplateEditRequest.json
1310113219
TemplateRemoveUserRequest:
1310213220
summary: 'Default Example'
1310313221
value:

0 commit comments

Comments
 (0)