-
Notifications
You must be signed in to change notification settings - Fork 11
/
bucket_url.go
36 lines (28 loc) · 1.06 KB
/
bucket_url.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
// Copyright 2018 Crisp IM SAS All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package crisp
// BucketURLRequest mapping
type BucketURLRequest struct {
Namespace string `json:"namespace,omitempty"`
ID string `json:"id,omitempty"`
File BucketURLRequestFile `json:"file,omitempty"`
Resource *BucketURLRequestResource `json:"resource,omitempty"`
}
// BucketURLRequestFile mapping
type BucketURLRequestFile struct {
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
}
// BucketURLRequestResource mapping
type BucketURLRequestResource struct {
Type string `json:"type,omitempty"`
ID string `json:"id,omitempty"`
}
// GenerateBucketURL generates a bucket URL.
func (service *BucketService) GenerateBucketURL(bucketData BucketURLRequest) (*Response, error) {
url := "bucket/url/generate"
req, _ := service.client.NewRequest("POST", url, bucketData)
return service.client.Do(req, nil)
}