@@ -21,7 +21,7 @@ const (
2121 ProjectStatusDisabled ProjectStatus = "STATUS_DISABLED"
2222)
2323
24- type Client interface {
24+ type ApplicationLoadBalancerClient interface {
2525 GetLoadBalancer (ctx context.Context , projectID , region , name string ) (* albsdk.LoadBalancer , error )
2626 DeleteLoadBalancer (ctx context.Context , projectID , region , name string ) error
2727 CreateLoadBalancer (ctx context.Context , projectID , region string , albsdk * albsdk.CreateLoadBalancerPayload ) (* albsdk.LoadBalancer , error )
@@ -34,17 +34,17 @@ type Client interface {
3434 DeleteCredentials (ctx context.Context , projectID , region , credentialRef string ) error
3535}
3636
37- type client struct {
37+ type applicationLoadBalancerClient struct {
3838 client * albsdk.APIClient
3939}
4040
41- var _ Client = (* client )(nil )
41+ var _ ApplicationLoadBalancerClient = (* applicationLoadBalancerClient )(nil )
4242
43- func NewClient (cl * albsdk.APIClient ) (Client , error ) {
44- return & client {client : cl }, nil
43+ func NewApplicationLoadBalancerClient (cl * albsdk.APIClient ) (ApplicationLoadBalancerClient , error ) {
44+ return & applicationLoadBalancerClient {client : cl }, nil
4545}
4646
47- func (cl client ) GetLoadBalancer (ctx context.Context , projectID , region , name string ) (* albsdk.LoadBalancer , error ) {
47+ func (cl applicationLoadBalancerClient ) GetLoadBalancer (ctx context.Context , projectID , region , name string ) (* albsdk.LoadBalancer , error ) {
4848 lb , err := cl .client .DefaultAPI .GetLoadBalancer (ctx , projectID , region , name ).Execute ()
4949 if isOpenAPINotFound (err ) {
5050 return lb , ErrorNotFound
@@ -53,32 +53,32 @@ func (cl client) GetLoadBalancer(ctx context.Context, projectID, region, name st
5353}
5454
5555// DeleteLoadBalancer returns no error if the load balancer doesn't exist.
56- func (cl client ) DeleteLoadBalancer (ctx context.Context , projectID , region , name string ) error {
56+ func (cl applicationLoadBalancerClient ) DeleteLoadBalancer (ctx context.Context , projectID , region , name string ) error {
5757 _ , err := cl .client .DefaultAPI .DeleteLoadBalancer (ctx , projectID , region , name ).Execute ()
5858 return err
5959}
6060
6161// CreateLoadBalancer returns ErrorNotFound if the project is not enabled.
62- func (cl client ) CreateLoadBalancer (ctx context.Context , projectID , region string , create * albsdk.CreateLoadBalancerPayload ) (* albsdk.LoadBalancer , error ) {
62+ func (cl applicationLoadBalancerClient ) CreateLoadBalancer (ctx context.Context , projectID , region string , create * albsdk.CreateLoadBalancerPayload ) (* albsdk.LoadBalancer , error ) {
6363 lb , err := cl .client .DefaultAPI .CreateLoadBalancer (ctx , projectID , region ).CreateLoadBalancerPayload (* create ).XRequestID (uuid .NewString ()).Execute ()
6464 if isOpenAPINotFound (err ) {
6565 return lb , ErrorNotFound
6666 }
6767 return lb , err
6868}
6969
70- func (cl client ) UpdateLoadBalancer (ctx context.Context , projectID , region , name string , update * albsdk.UpdateLoadBalancerPayload ) (
70+ func (cl applicationLoadBalancerClient ) UpdateLoadBalancer (ctx context.Context , projectID , region , name string , update * albsdk.UpdateLoadBalancerPayload ) (
7171 * albsdk.LoadBalancer , error ,
7272) {
7373 return cl .client .DefaultAPI .UpdateLoadBalancer (ctx , projectID , region , name ).UpdateLoadBalancerPayload (* update ).Execute ()
7474}
7575
76- func (cl client ) UpdateTargetPool (ctx context.Context , projectID , region , name , targetPoolName string , payload albsdk.UpdateTargetPoolPayload ) error {
76+ func (cl applicationLoadBalancerClient ) UpdateTargetPool (ctx context.Context , projectID , region , name , targetPoolName string , payload albsdk.UpdateTargetPoolPayload ) error {
7777 _ , err := cl .client .DefaultAPI .UpdateTargetPool (ctx , projectID , region , name , targetPoolName ).UpdateTargetPoolPayload (payload ).Execute ()
7878 return err
7979}
8080
81- func (cl client ) CreateCredentials (
81+ func (cl applicationLoadBalancerClient ) CreateCredentials (
8282 ctx context.Context ,
8383 projectID string ,
8484 region string ,
@@ -87,23 +87,23 @@ func (cl client) CreateCredentials(
8787 return cl .client .DefaultAPI .CreateCredentials (ctx , projectID , region ).CreateCredentialsPayload (payload ).XRequestID (uuid .NewString ()).Execute ()
8888}
8989
90- func (cl client ) ListCredentials (ctx context.Context , projectID , region string ) (* albsdk.ListCredentialsResponse , error ) {
90+ func (cl applicationLoadBalancerClient ) ListCredentials (ctx context.Context , projectID , region string ) (* albsdk.ListCredentialsResponse , error ) {
9191 return cl .client .DefaultAPI .ListCredentials (ctx , projectID , region ).Execute ()
9292}
9393
94- func (cl client ) GetCredentials (ctx context.Context , projectID , region , credentialsRef string ) (* albsdk.GetCredentialsResponse , error ) {
94+ func (cl applicationLoadBalancerClient ) GetCredentials (ctx context.Context , projectID , region , credentialsRef string ) (* albsdk.GetCredentialsResponse , error ) {
9595 return cl .client .DefaultAPI .GetCredentials (ctx , projectID , region , credentialsRef ).Execute ()
9696}
9797
98- func (cl client ) UpdateCredentials (ctx context.Context , projectID , region , credentialsRef string , payload albsdk.UpdateCredentialsPayload ) error {
98+ func (cl applicationLoadBalancerClient ) UpdateCredentials (ctx context.Context , projectID , region , credentialsRef string , payload albsdk.UpdateCredentialsPayload ) error {
9999 _ , err := cl .client .DefaultAPI .UpdateCredentials (ctx , projectID , region , credentialsRef ).UpdateCredentialsPayload (payload ).Execute ()
100100 if err != nil {
101101 return err
102102 }
103103 return nil
104104}
105105
106- func (cl client ) DeleteCredentials (ctx context.Context , projectID , region , credentialsRef string ) error {
106+ func (cl applicationLoadBalancerClient ) DeleteCredentials (ctx context.Context , projectID , region , credentialsRef string ) error {
107107 _ , err := cl .client .DefaultAPI .DeleteCredentials (ctx , projectID , region , credentialsRef ).Execute ()
108108 if err != nil {
109109 return err
0 commit comments