Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up constants in aztables #21258

Merged
merged 2 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/data/aztables/autorest.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ security-scopes: "https://storage.azure.com/.default"
honor-body-placement: true
modelerfour:
group-parameters: false
seal-single-value-enum-by-default: true

directive:
- from: source-file-go
Expand Down
18 changes: 7 additions & 11 deletions sdk/data/aztables/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (t *Client) CreateTable(ctx context.Context, options *CreateTableOptions) (
if options == nil {
options = &CreateTableOptions{}
}
resp, err := t.client.Create(ctx, generated.Enum1Three0, generated.TableProperties{TableName: &t.name}, options.toGenerated(), &generated.QueryOptions{})
resp, err := t.client.Create(ctx, generated.TableProperties{TableName: &t.name}, options.toGenerated(), &generated.QueryOptions{})
if err != nil {
return CreateTableResponse{}, err
}
Expand Down Expand Up @@ -241,7 +241,7 @@ func (t *Client) NewListEntitiesPager(listOptions *ListEntitiesOptions) *runtime
partKey = listOptions.NextPartitionKey
rowKey = listOptions.NextRowKey
}
resp, err := t.client.QueryEntities(ctx, generated.Enum1Three0, t.name, &generated.TableClientQueryEntitiesOptions{
resp, err := t.client.QueryEntities(ctx, t.name, &generated.TableClientQueryEntitiesOptions{
NextPartitionKey: partKey,
NextRowKey: rowKey,
}, listOptions.toQueryOptions())
Expand Down Expand Up @@ -297,7 +297,7 @@ func (t *Client) GetEntity(ctx context.Context, partitionKey string, rowKey stri
}

genOptions, queryOptions := options.toGenerated()
resp, err := t.client.QueryEntityWithPartitionAndRowKey(ctx, generated.Enum1Three0, t.name, prepareKey(partitionKey), prepareKey(rowKey), genOptions, queryOptions)
resp, err := t.client.QueryEntityWithPartitionAndRowKey(ctx, t.name, prepareKey(partitionKey), prepareKey(rowKey), genOptions, queryOptions)
if err != nil {
return GetEntityResponse{}, err
}
Expand Down Expand Up @@ -338,7 +338,7 @@ func (t *Client) AddEntity(ctx context.Context, entity []byte, options *AddEntit
if err != nil {
return AddEntityResponse{}, err
}
resp, err := t.client.InsertEntity(ctx, generated.Enum1Three0, t.name, &generated.TableClientInsertEntityOptions{TableEntityProperties: mapEntity, ResponsePreference: to.Ptr(generated.ResponseFormatReturnNoContent)}, nil)
resp, err := t.client.InsertEntity(ctx, t.name, &generated.TableClientInsertEntityOptions{TableEntityProperties: mapEntity, ResponsePreference: to.Ptr(generated.ResponseFormatReturnNoContent)}, nil)
if err != nil {
err = checkEntityForPkRk(&mapEntity, err)
return AddEntityResponse{}, err
Expand Down Expand Up @@ -374,7 +374,7 @@ func (t *Client) DeleteEntity(ctx context.Context, partitionKey string, rowKey s
nilEtag := azcore.ETag("*")
options.IfMatch = &nilEtag
}
resp, err := t.client.DeleteEntity(ctx, generated.Enum1Three0, t.name, prepareKey(partitionKey), prepareKey(rowKey), string(*options.IfMatch), options.toGenerated(), &generated.QueryOptions{})
resp, err := t.client.DeleteEntity(ctx, t.name, prepareKey(partitionKey), prepareKey(rowKey), string(*options.IfMatch), options.toGenerated(), &generated.QueryOptions{})
if err != nil {
return DeleteEntityResponse{}, err
}
Expand Down Expand Up @@ -474,7 +474,6 @@ func (t *Client) UpdateEntity(ctx context.Context, entity []byte, options *Updat
case UpdateModeMerge:
resp, err := t.client.MergeEntity(
ctx,
generated.Enum1Three0,
t.name,
prepareKey(partKey),
prepareKey(rowkey),
Expand All @@ -488,7 +487,6 @@ func (t *Client) UpdateEntity(ctx context.Context, entity []byte, options *Updat
case UpdateModeReplace:
resp, err := t.client.UpdateEntity(
ctx,
generated.Enum1Three0,
t.name,
prepareKey(partKey),
prepareKey(rowkey),
Expand Down Expand Up @@ -577,7 +575,6 @@ func (t *Client) UpsertEntity(ctx context.Context, entity []byte, options *Upser
case UpdateModeMerge:
resp, err := t.client.MergeEntity(
ctx,
generated.Enum1Three0,
t.name,
prepareKey(partKey),
prepareKey(rowkey),
Expand All @@ -591,7 +588,6 @@ func (t *Client) UpsertEntity(ctx context.Context, entity []byte, options *Upser
case UpdateModeReplace:
resp, err := t.client.UpdateEntity(
ctx,
generated.Enum1Three0,
t.name,
prepareKey(partKey),
prepareKey(rowkey),
Expand Down Expand Up @@ -641,7 +637,7 @@ func getAccessPolicyResponseFromGenerated(g *generated.TableClientGetAccessPolic
// If the service returns a non-successful HTTP status code, the function returns an *azcore.ResponseError type.
// Specify nil for options if you want to use the default options.
func (t *Client) GetAccessPolicy(ctx context.Context, options *GetAccessPolicyOptions) (GetAccessPolicyResponse, error) {
resp, err := t.client.GetAccessPolicy(ctx, t.name, generated.Enum4ACL, options.toGenerated())
resp, err := t.client.GetAccessPolicy(ctx, t.name, options.toGenerated())
if err != nil {
return GetAccessPolicyResponse{}, err
}
Expand Down Expand Up @@ -679,7 +675,7 @@ func (t *Client) SetAccessPolicy(ctx context.Context, options *SetAccessPolicyOp
if options == nil {
options = &SetAccessPolicyOptions{}
}
response, err := t.client.SetAccessPolicy(ctx, t.name, generated.Enum4ACL, options.toGenerated())
response, err := t.client.SetAccessPolicy(ctx, t.name, options.toGenerated())
if err != nil && len(options.TableACL) > 5 {
err = errTooManyAccessPoliciesError
}
Expand Down
1 change: 0 additions & 1 deletion sdk/data/aztables/internal/service_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ func NewServiceClient(endpoint string, plOpts runtime.PipelineOptions, options *
return &ServiceClient{
endpoint: endpoint,
internal: client,
version: Enum0TwoThousandNineteen0202,
}, nil
}

Expand Down
1 change: 0 additions & 1 deletion sdk/data/aztables/internal/table_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ func NewTableClient(endpoint string, plOpts runtime.PipelineOptions, options *az
return &TableClient{
endpoint: endpoint,
internal: client,
version: Enum0TwoThousandNineteen0202,
}, nil
}

Expand Down
78 changes: 0 additions & 78 deletions sdk/data/aztables/internal/zz_constants.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 18 additions & 25 deletions sdk/data/aztables/internal/zz_service_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading