forked from kyma-project/control-plane
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dto.go
72 lines (61 loc) · 2.35 KB
/
dto.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
package internal
import (
"reflect"
)
type ProvisioningParameters struct {
PlanID string `json:"plan_id"`
ServiceID string `json:"service_id"`
ErsContext ERSContext `json:"ers_context"`
Parameters ProvisioningParametersDTO `json:"parameters"`
// PlatformRegion defines the Platform region send in the request path, terminology:
// - `Platform` is a place where KEB is registered and which later sends request to KEB.
// - `Region` value is use e.g. for billing integration such as EDP.
PlatformRegion string `json:"platform_region"`
}
func (p ProvisioningParameters) IsEqual(input ProvisioningParameters) bool {
if p.PlanID != input.PlanID {
return false
}
if p.ServiceID != input.ServiceID {
return false
}
if !reflect.DeepEqual(p.ErsContext, input.ErsContext) {
return false
}
if !reflect.DeepEqual(p.Parameters, input.Parameters) {
return false
}
return true
}
type ProvisioningParametersDTO struct {
Name string `json:"name"`
TargetSecret *string `json:"targetSecret"`
VolumeSizeGb *int `json:"volumeSizeGb"`
MachineType *string `json:"machineType"`
Region *string `json:"region"`
Purpose *string `json:"purpose"`
Zones []string `json:"zones"`
AutoScalerMin *int `json:"autoScalerMin"`
AutoScalerMax *int `json:"autoScalerMax"`
MaxSurge *int `json:"maxSurge"`
MaxUnavailable *int `json:"maxUnavailable"`
OptionalComponentsToInstall []string `json:"components"`
KymaVersion string `json:"kymaVersion"`
}
type ERSContext struct {
TenantID string `json:"tenant_id"`
SubAccountID string `json:"subaccount_id"`
GlobalAccountID string `json:"globalaccount_id"`
ServiceManager *ServiceManagerEntryDTO `json:"sm_platform_credentials,omitempty"`
}
type ServiceManagerEntryDTO struct {
Credentials ServiceManagerCredentials `json:"credentials"`
URL string `json:"url"`
}
type ServiceManagerCredentials struct {
BasicAuth ServiceManagerBasicAuth `json:"basic"`
}
type ServiceManagerBasicAuth struct {
Username string `json:"username"`
Password string `json:"password"`
}