This repository has been archived by the owner on Jul 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
environment.go
94 lines (83 loc) · 4.17 KB
/
environment.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
package doppler
type (
// Environment represents a doppler environment.
Environment struct {
ID *string `json:"id,omitempty"` // An identifier for the object.
Slug *string `json:"slug,omitempty"` // A unique identifier for the environment.
Name *string `json:"name,omitempty"` // Name of the environment.
Project *string `json:"project,omitempty"` // Identifier of the project the environment belongs to.
InitialFetchAt *string `json:"initial_fetch_at,omitempty"` // Date and time of the first secrets fetch from a config in the environment.
CreatedAt *string `json:"created_at,omitempty"` // Date and time of the object's creation.
}
// EnvironmentGetResponse represents a response from the environment get endpoint.
//
// Method: GET
// Endpoint: https://api.doppler.com/v3/environments/environment
// Docs: https://docs.doppler.com/reference/environment-retrieve
EnvironmentGetResponse struct {
APIResponse `json:",inline"`
Environment *Environment `json:"environment,omitempty"`
}
// EnvironmentGetOptions represents the options for the environment get endpoint.
EnvironmentGetOptions struct {
Project string `url:"project" json:"-"` // Identifier of the project the environment belongs to.
Slug string `url:"environment" json:"-"` // A unique identifier for the environment.
}
// EnvironmentListResponse represents a response from the environment list endpoint.
//
// Method: GET
// Endpoint: https://api.doppler.com/v3/environments
// Docs: https://docs.doppler.com/reference/environment-list
EnvironmentListResponse struct {
APIResponse `json:",inline"`
Environments []*Environment `json:"environments"`
}
// EnvironmentListOptions represents the query parameters for a environment list request.
EnvironmentListOptions struct {
Project string `url:"project" json:"-"` // Identifier of the project the environment belongs to.
}
// EnvironmentCreateResponse represents a response from the environment create endpoint.
//
// Method: POST
// Endpoint: https://api.doppler.com/v3/environments
// Docs: https://docs.doppler.com/reference/environment-create
EnvironmentCreateResponse struct {
APIResponse `json:",inline"`
Environment *Environment `json:"environment"`
}
// EnvironmentCreateOptions represents the body parameters for a environment create request.
EnvironmentCreateOptions struct {
Project string `url:"project" json:"-"` // Identifier of the project the environment belongs to.
Name string `url:"-" json:"name,omitempty"` // Name of the environment.
Slug string `url:"-" json:"slug,omitempty"` // A unique identifier for the environment.
}
// EnvironmentRenameResponse represents a doppler environment rename request.
//
// Method: POST
// Endpoint: https://api.doppler.com/v3/environments/environment
// Docs: https://docs.doppler.com/reference/environment-rename
EnvironmentRenameResponse struct {
APIResponse `json:",inline"`
Environment *Environment `json:"environment"`
}
// EnvironmentRenameOptions represents the body parameters for a environment rename request.
EnvironmentRenameOptions struct {
Project string `url:"project" json:"-"` // Identifier of the project the environment belongs to.
Slug string `url:"environment" json:"-"` // A unique identifier for the environment.
NewName *string `url:"-" json:"name,omitempty"` // New name of the environment.
NewSlug *string `url:"-" json:"slug,omitempty"` // New slug of the environment.
}
// EnvironmentDeleteResponse represents a response from the environment delete endpoint.
//
// Method: DELETE
// Endpoint: https://api.doppler.com/v3/environments/environment
// Docs: https://docs.doppler.com/reference/environment-delete
EnvironmentDeleteResponse struct {
APIResponse `json:",inline"`
}
// EnvironmentDeleteOptions represents the body parameters for a environment delete request.
EnvironmentDeleteOptions struct {
Project string `url:"project" json:"-"` // Identifier of the project the environment belongs to.
Slug string `url:"environment" json:"-"` // A unique identifier for the environment.
}
)