/
api_op_fetch.go
98 lines (88 loc) · 6 KB
/
api_op_fetch.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// Package configuration contains auto-generated files. DO NOT MODIFY
package configuration
import (
"context"
"net/http"
"time"
"github.com/RJPearson94/twilio-sdk-go/client"
)
type FetchConfigurationIntegrationResponse struct {
Active bool `json:"active"`
Author *string `json:"author,omitempty"`
Config string `json:"config"`
Logo *string `json:"logo,omitempty"`
Name string `json:"name"`
Type string `json:"type"`
}
type FetchConfigurationSkillResponse struct {
Maximum bool `json:"maximum"`
Minimum int `json:"minimum"`
MultiValue bool `json:"multivalue"`
Name string `json:"name"`
}
type FetchConfigurationTaskQueueResponse struct {
Sid string `json:"sid"`
Targettable bool `json:"targettable"`
}
type FetchConfigurationWorkerChannelResponse struct {
Availability bool `json:"availability"`
Capacity int `json:"capacity"`
Name string `json:"name"`
}
// FetchConfigurationResponse defines the response fields for the retrieved configuration
type FetchConfigurationResponse struct {
AccountSid string `json:"account_sid"`
Attributes *interface{} `json:"attributes,omitempty"`
CallRecordingEnabled *bool `json:"call_recording_enabled,omitempty"`
CallRecordingWebhookURL *string `json:"call_recording_webhook_url,omitempty"`
ChatServiceInstanceSid *string `json:"chat_service_instance_sid,omitempty"`
CrmAttributes *interface{} `json:"crm_attributes,omitempty"`
CrmCallbackURL *string `json:"crm_callback_url,omitempty"`
CrmEnabled *bool `json:"crm_enabled,omitempty"`
CrmFallbackURL *string `json:"crm_fallback_url,omitempty"`
CrmType *string `json:"crm_type,omitempty"`
DateCreated time.Time `json:"date_created"`
DateUpdated *time.Time `json:"date_updated,omitempty"`
FlexServiceInstanceSid string `json:"flex_service_instance_sid"`
Integrations *[]FetchConfigurationIntegrationResponse `json:"integrations,omitempty"`
MessagingServiceInstanceSid *string `json:"messaging_service_instance_sid,omitempty"`
OutboundCallFlows *interface{} `json:"outbound_call_flows,omitempty"`
PluginServiceAttributes *interface{} `json:"plugin_service_attributes,omitempty"`
PluginServiceEnabled *bool `json:"plugin_service_enabled,omitempty"`
PublicAttributes *interface{} `json:"public_attributes,omitempty"`
QueueStatsConfiguration *interface{} `json:"queue_stats_configuration,omitempty"`
RuntimeDomain string `json:"runtime_domain"`
ServerlessServiceSids *[]string `json:"serverless_service_sids,omitempty"`
ServiceVersion *string `json:"service_version,omitempty"`
Status string `json:"status"`
TaskRouterOfflineActivitySid string `json:"taskrouter_offline_activity_sid"`
TaskRouterSkills *[]FetchConfigurationSkillResponse `json:"taskrouter_skills,omitempty"`
TaskRouterTargetTaskQueueSid string `json:"taskrouter_target_taskqueue_sid"`
TaskRouterTargetWorkflowSid string `json:"taskrouter_target_workflow_sid"`
TaskRouterTaskQueues *[]FetchConfigurationTaskQueueResponse `json:"taskrouter_taskqueues,omitempty"`
TaskRouterWorkerAttributes *map[string]interface{} `json:"taskrouter_worker_attributes,omitempty"`
TaskRouterWorkerChannels *map[string][]FetchConfigurationWorkerChannelResponse `json:"taskrouter_worker_channels,omitempty"`
TaskRouterWorkspaceSid string `json:"taskrouter_workspace_sid"`
URL string `json:"url"`
UiAttributes *interface{} `json:"ui_attributes,omitempty"`
UiDependencies *interface{} `json:"ui_dependencies,omitempty"`
UiLanguage *string `json:"ui_language,omitempty"`
UiVersion string `json:"ui_version"`
}
// Fetch retrieves a configuration resource
// Context is defaulted to Background. See https://golang.org/pkg/context/#Background for more information
func (c Client) Fetch() (*FetchConfigurationResponse, error) {
return c.FetchWithContext(context.Background())
}
// FetchWithContext retrieves a configuration resource
func (c Client) FetchWithContext(context context.Context) (*FetchConfigurationResponse, error) {
op := client.Operation{
Method: http.MethodGet,
URI: "/Configuration",
}
response := &FetchConfigurationResponse{}
if err := c.client.Send(context, op, nil, response); err != nil {
return nil, err
}
return response, nil
}