diff --git a/api_open_fga.go b/api_open_fga.go index 2d89972..99f2388 100644 --- a/api_open_fga.go +++ b/api_open_fga.go @@ -1086,13 +1086,17 @@ func (a *OpenFgaApiService) CheckExecute(r ApiCheckRequest) (CheckResponse, *_ne } metrics := telemetry.GetMetrics(telemetry.TelemetryFactoryParameters{Configuration: a.client.cfg.Telemetry}) + params := map[string]interface{}{ + "body": localVarPostBody, + } + + if storeId := getStoreID(r); storeId != "" { + params["storeId"] = storeId + } var attrs, queryDuration, requestDuration, _ = metrics.BuildTelemetryAttributes( "Check", - map[string]interface{}{ - "storeId": r.storeId, - "body": localVarPostBody, - }, + params, req, localVarHTTPResponse, requestStarted, @@ -1359,12 +1363,17 @@ func (a *OpenFgaApiService) CreateStoreExecute(r ApiCreateStoreRequest) (CreateS } metrics := telemetry.GetMetrics(telemetry.TelemetryFactoryParameters{Configuration: a.client.cfg.Telemetry}) + params := map[string]interface{}{ + "body": localVarPostBody, + } + + if storeId := getStoreID(r); storeId != "" { + params["storeId"] = storeId + } var attrs, queryDuration, requestDuration, _ = metrics.BuildTelemetryAttributes( "CreateStore", - map[string]interface{}{ - "body": localVarPostBody, - }, + params, req, localVarHTTPResponse, requestStarted, @@ -1623,13 +1632,17 @@ func (a *OpenFgaApiService) DeleteStoreExecute(r ApiDeleteStoreRequest) (*_netht } metrics := telemetry.GetMetrics(telemetry.TelemetryFactoryParameters{Configuration: a.client.cfg.Telemetry}) + params := map[string]interface{}{ + "body": localVarPostBody, + } + + if storeId := getStoreID(r); storeId != "" { + params["storeId"] = storeId + } var attrs, queryDuration, requestDuration, _ = metrics.BuildTelemetryAttributes( "DeleteStore", - map[string]interface{}{ - "storeId": r.storeId, - "body": localVarPostBody, - }, + params, req, localVarHTTPResponse, requestStarted, @@ -1962,13 +1975,17 @@ func (a *OpenFgaApiService) ExpandExecute(r ApiExpandRequest) (ExpandResponse, * } metrics := telemetry.GetMetrics(telemetry.TelemetryFactoryParameters{Configuration: a.client.cfg.Telemetry}) + params := map[string]interface{}{ + "body": localVarPostBody, + } + + if storeId := getStoreID(r); storeId != "" { + params["storeId"] = storeId + } var attrs, queryDuration, requestDuration, _ = metrics.BuildTelemetryAttributes( "Expand", - map[string]interface{}{ - "storeId": r.storeId, - "body": localVarPostBody, - }, + params, req, localVarHTTPResponse, requestStarted, @@ -2238,13 +2255,17 @@ func (a *OpenFgaApiService) GetStoreExecute(r ApiGetStoreRequest) (GetStoreRespo } metrics := telemetry.GetMetrics(telemetry.TelemetryFactoryParameters{Configuration: a.client.cfg.Telemetry}) + params := map[string]interface{}{ + "body": localVarPostBody, + } + + if storeId := getStoreID(r); storeId != "" { + params["storeId"] = storeId + } var attrs, queryDuration, requestDuration, _ = metrics.BuildTelemetryAttributes( "GetStore", - map[string]interface{}{ - "storeId": r.storeId, - "body": localVarPostBody, - }, + params, req, localVarHTTPResponse, requestStarted, @@ -2533,13 +2554,17 @@ func (a *OpenFgaApiService) ListObjectsExecute(r ApiListObjectsRequest) (ListObj } metrics := telemetry.GetMetrics(telemetry.TelemetryFactoryParameters{Configuration: a.client.cfg.Telemetry}) + params := map[string]interface{}{ + "body": localVarPostBody, + } + + if storeId := getStoreID(r); storeId != "" { + params["storeId"] = storeId + } var attrs, queryDuration, requestDuration, _ = metrics.BuildTelemetryAttributes( "ListObjects", - map[string]interface{}{ - "storeId": r.storeId, - "body": localVarPostBody, - }, + params, req, localVarHTTPResponse, requestStarted, @@ -2815,12 +2840,17 @@ func (a *OpenFgaApiService) ListStoresExecute(r ApiListStoresRequest) (ListStore } metrics := telemetry.GetMetrics(telemetry.TelemetryFactoryParameters{Configuration: a.client.cfg.Telemetry}) + params := map[string]interface{}{ + "body": localVarPostBody, + } + + if storeId := getStoreID(r); storeId != "" { + params["storeId"] = storeId + } var attrs, queryDuration, requestDuration, _ = metrics.BuildTelemetryAttributes( "ListStores", - map[string]interface{}{ - "body": localVarPostBody, - }, + params, req, localVarHTTPResponse, requestStarted, @@ -3111,13 +3141,17 @@ func (a *OpenFgaApiService) ListUsersExecute(r ApiListUsersRequest) (ListUsersRe } metrics := telemetry.GetMetrics(telemetry.TelemetryFactoryParameters{Configuration: a.client.cfg.Telemetry}) + params := map[string]interface{}{ + "body": localVarPostBody, + } + + if storeId := getStoreID(r); storeId != "" { + params["storeId"] = storeId + } var attrs, queryDuration, requestDuration, _ = metrics.BuildTelemetryAttributes( "ListUsers", - map[string]interface{}{ - "storeId": r.storeId, - "body": localVarPostBody, - }, + params, req, localVarHTTPResponse, requestStarted, @@ -3509,13 +3543,17 @@ func (a *OpenFgaApiService) ReadExecute(r ApiReadRequest) (ReadResponse, *_netht } metrics := telemetry.GetMetrics(telemetry.TelemetryFactoryParameters{Configuration: a.client.cfg.Telemetry}) + params := map[string]interface{}{ + "body": localVarPostBody, + } + + if storeId := getStoreID(r); storeId != "" { + params["storeId"] = storeId + } var attrs, queryDuration, requestDuration, _ = metrics.BuildTelemetryAttributes( "Read", - map[string]interface{}{ - "storeId": r.storeId, - "body": localVarPostBody, - }, + params, req, localVarHTTPResponse, requestStarted, @@ -3793,13 +3831,17 @@ func (a *OpenFgaApiService) ReadAssertionsExecute(r ApiReadAssertionsRequest) (R } metrics := telemetry.GetMetrics(telemetry.TelemetryFactoryParameters{Configuration: a.client.cfg.Telemetry}) + params := map[string]interface{}{ + "body": localVarPostBody, + } + + if storeId := getStoreID(r); storeId != "" { + params["storeId"] = storeId + } var attrs, queryDuration, requestDuration, _ = metrics.BuildTelemetryAttributes( "ReadAssertions", - map[string]interface{}{ - "storeId": r.storeId, - "body": localVarPostBody, - }, + params, req, localVarHTTPResponse, requestStarted, @@ -4120,13 +4162,17 @@ func (a *OpenFgaApiService) ReadAuthorizationModelExecute(r ApiReadAuthorization } metrics := telemetry.GetMetrics(telemetry.TelemetryFactoryParameters{Configuration: a.client.cfg.Telemetry}) + params := map[string]interface{}{ + "body": localVarPostBody, + } + + if storeId := getStoreID(r); storeId != "" { + params["storeId"] = storeId + } var attrs, queryDuration, requestDuration, _ = metrics.BuildTelemetryAttributes( "ReadAuthorizationModel", - map[string]interface{}{ - "storeId": r.storeId, - "body": localVarPostBody, - }, + params, req, localVarHTTPResponse, requestStarted, @@ -4454,13 +4500,17 @@ func (a *OpenFgaApiService) ReadAuthorizationModelsExecute(r ApiReadAuthorizatio } metrics := telemetry.GetMetrics(telemetry.TelemetryFactoryParameters{Configuration: a.client.cfg.Telemetry}) + params := map[string]interface{}{ + "body": localVarPostBody, + } + + if storeId := getStoreID(r); storeId != "" { + params["storeId"] = storeId + } var attrs, queryDuration, requestDuration, _ = metrics.BuildTelemetryAttributes( "ReadAuthorizationModels", - map[string]interface{}{ - "storeId": r.storeId, - "body": localVarPostBody, - }, + params, req, localVarHTTPResponse, requestStarted, @@ -4760,13 +4810,17 @@ func (a *OpenFgaApiService) ReadChangesExecute(r ApiReadChangesRequest) (ReadCha } metrics := telemetry.GetMetrics(telemetry.TelemetryFactoryParameters{Configuration: a.client.cfg.Telemetry}) + params := map[string]interface{}{ + "body": localVarPostBody, + } + + if storeId := getStoreID(r); storeId != "" { + params["storeId"] = storeId + } var attrs, queryDuration, requestDuration, _ = metrics.BuildTelemetryAttributes( "ReadChanges", - map[string]interface{}{ - "storeId": r.storeId, - "body": localVarPostBody, - }, + params, req, localVarHTTPResponse, requestStarted, @@ -5089,13 +5143,17 @@ func (a *OpenFgaApiService) WriteExecute(r ApiWriteRequest) (map[string]interfac } metrics := telemetry.GetMetrics(telemetry.TelemetryFactoryParameters{Configuration: a.client.cfg.Telemetry}) + params := map[string]interface{}{ + "body": localVarPostBody, + } + + if storeId := getStoreID(r); storeId != "" { + params["storeId"] = storeId + } var attrs, queryDuration, requestDuration, _ = metrics.BuildTelemetryAttributes( "Write", - map[string]interface{}{ - "storeId": r.storeId, - "body": localVarPostBody, - }, + params, req, localVarHTTPResponse, requestStarted, @@ -5373,13 +5431,17 @@ func (a *OpenFgaApiService) WriteAssertionsExecute(r ApiWriteAssertionsRequest) } metrics := telemetry.GetMetrics(telemetry.TelemetryFactoryParameters{Configuration: a.client.cfg.Telemetry}) + params := map[string]interface{}{ + "body": localVarPostBody, + } + + if storeId := getStoreID(r); storeId != "" { + params["storeId"] = storeId + } var attrs, queryDuration, requestDuration, _ = metrics.BuildTelemetryAttributes( "WriteAssertions", - map[string]interface{}{ - "storeId": r.storeId, - "body": localVarPostBody, - }, + params, req, localVarHTTPResponse, requestStarted, @@ -5704,13 +5766,17 @@ func (a *OpenFgaApiService) WriteAuthorizationModelExecute(r ApiWriteAuthorizati } metrics := telemetry.GetMetrics(telemetry.TelemetryFactoryParameters{Configuration: a.client.cfg.Telemetry}) + params := map[string]interface{}{ + "body": localVarPostBody, + } + + if storeId := getStoreID(r); storeId != "" { + params["storeId"] = storeId + } var attrs, queryDuration, requestDuration, _ = metrics.BuildTelemetryAttributes( "WriteAuthorizationModel", - map[string]interface{}{ - "storeId": r.storeId, - "body": localVarPostBody, - }, + params, req, localVarHTTPResponse, requestStarted, @@ -5731,3 +5797,15 @@ func (a *OpenFgaApiService) WriteAuthorizationModelExecute(r ApiWriteAuthorizati var localVarReturnValue WriteAuthorizationModelResponse return localVarReturnValue, nil, reportError("Error not handled properly") } + +type withStoreId struct { + storeId string +} + +func getStoreID(i interface{}) string { + if r, ok := i.(withStoreId); ok { + return r.storeId + } + + return "" +}