-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create keys * update * Hashed formatting * fix error messages * fix get key value from plan * add data and tests * rm stg * docs * PlanModifier
- Loading branch information
Showing
14 changed files
with
2,015 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package clientset | ||
|
||
import ( | ||
"context" | ||
apikeys "terraform-provider-coralogix/coralogix/clientset/grpc/apikeys" | ||
) | ||
|
||
type ApikeysClient struct { | ||
callPropertiesCreator *CallPropertiesCreator | ||
} | ||
|
||
func (t ApikeysClient) CreateApiKey(ctx context.Context, req *apikeys.CreateApiKeyRequest) (*apikeys.CreateApiKeyResponse, error) { | ||
callProperties, err := t.callPropertiesCreator.GetCallProperties(ctx) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
conn := callProperties.Connection | ||
defer conn.Close() | ||
client := apikeys.NewApiKeysServiceClient(conn) | ||
|
||
return client.CreateApiKey(callProperties.Ctx, req, callProperties.CallOptions...) | ||
} | ||
|
||
func (t ApikeysClient) GetApiKey(ctx context.Context, req *apikeys.GetApiKeyRequest) (*apikeys.GetApiKeyResponse, error) { | ||
callProperties, err := t.callPropertiesCreator.GetCallProperties(ctx) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
conn := callProperties.Connection | ||
defer conn.Close() | ||
client := apikeys.NewApiKeysServiceClient(conn) | ||
|
||
return client.GetApiKey(callProperties.Ctx, req, callProperties.CallOptions...) | ||
} | ||
|
||
func (t ApikeysClient) UpdateApiKey(ctx context.Context, req *apikeys.UpdateApiKeyRequest) (*apikeys.UpdateApiKeyResponse, error) { | ||
callProperties, err := t.callPropertiesCreator.GetCallProperties(ctx) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
conn := callProperties.Connection | ||
defer conn.Close() | ||
client := apikeys.NewApiKeysServiceClient(conn) | ||
|
||
return client.UpdateApiKey(callProperties.Ctx, req, callProperties.CallOptions...) | ||
} | ||
|
||
func (t ApikeysClient) DeleteApiKey(ctx context.Context, req *apikeys.DeleteApiKeyRequest) (*apikeys.DeleteApiKeyResponse, error) { | ||
callProperties, err := t.callPropertiesCreator.GetCallProperties(ctx) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
conn := callProperties.Connection | ||
defer conn.Close() | ||
client := apikeys.NewApiKeysServiceClient(conn) | ||
|
||
return client.DeleteApiKey(callProperties.Ctx, req, callProperties.CallOptions...) | ||
} | ||
|
||
func NewApiKeysClient(c *CallPropertiesCreator) *ApikeysClient { | ||
return &ApikeysClient{callPropertiesCreator: c} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.