From 23b6eaecad08282914a14b5e7671f6e4c3b1dc22 Mon Sep 17 00:00:00 2001 From: HarryWong Date: Mon, 9 Oct 2023 12:09:51 +0800 Subject: [PATCH] feat: update --- .gitignore | 37 + README.md | 71 +- api.go | 29 - api_apps.go | 575 +++++++++ api_chain.go | 191 +++ api_group.go | 104 ++ api_groups.go | 726 +++++++++++ api_keystore.go | 117 ++ api_light_node.go | 1130 +++++++++++++++++ api_management.go | 865 +++++++++++++ api_node.go | 357 ++++++ api_tools.go | 117 ++ api_user.go | 355 ++++++ apps.go | 57 - chain.go | 42 - client.go | 569 +++++++++ configuration.go | 130 ++ go.mod | 12 +- go.sum | 48 +- group.go | 18 - groups.go | 155 --- keystore.go | 18 - management.go | 135 -- model/model_api_addr_proto_pair.go | 17 - model/model_api_group_info.go | 28 - model/model_api_grp_user_result.go | 22 - model/model_api_join_group_result.go | 24 - model/model_api_snapshot_info.go | 20 - .../model_appapi_group_content_object_item.go | 19 - model/model_chain_publish_queue_item.go | 22 - model/model_handlers_group_seed.go | 23 - model/model_handlers_network_info.go | 21 - model/model_handlers_node_info.go | 20 - model/model_handlers_pub_queue_info.go | 16 - model/model_pb_activity.go | 49 - model/model_pb_block.go | 23 - model/model_pb_file.go | 20 - model/model_pb_image.go | 19 - model/model_pb_link.go | 22 - model/model_pb_object.go | 43 - model/model_pb_payment.go | 17 - model/model_pb_person.go | 18 - model/model_pb_reply.go | 16 - model/model_pb_trx.go | 26 - model/model_timestamppb_timestamp.go | 18 - ....go => model_api_add_relay_servers_resp.go | 3 +- model_api_get_user_encrypt_pub_keys_result.go | 14 + model_api_group_info.go | 28 + ...fo_list.go => model_api_group_info_list.go | 3 +- model_api_grp_info_node_sdk.go | 18 + ...er_param.go => model_api_grp_user_param.go | 9 +- model_api_grp_user_result.go | 21 + model_api_join_group_result.go | 23 + ...p.go => model_api_n_sdk_announce_params.go | 9 +- model_api_n_sdk_send_trx_params.go | 20 + ...bkey_param.go => model_api_pubkey_param.go | 3 +- ...o => model_api_pubkey_to_ethaddr_result.go | 9 +- ..._result.go => model_api_send_trx_result.go | 7 +- ..._tx_param.go => model_api_sign_tx_param.go | 13 +- ...x_result.go => model_api_sign_tx_result.go | 3 +- ...esult.go => model_api_start_sync_result.go | 5 +- ...ms.go => model_appapi_create_jwt_params.go | 11 +- model_appapi_revoke_jwt_params.go | 16 + ...oken_item.go => model_appapi_token_item.go | 3 +- model_def_rex_sync_result.go | 19 + ...lt.go => model_handlers_add_peer_result.go | 10 +- ...ram.go => model_handlers_announce_param.go | 9 +- ...lt.go => model_handlers_announce_result.go | 15 +- ...l_handlers_announced_producer_list_item.go | 14 +- ...model_handlers_announced_user_list_item.go | 13 +- ...o => model_handlers_app_config_key_item.go | 15 +- ...model_handlers_app_config_key_list_item.go | 3 +- ...m.go => model_handlers_app_config_param.go | 13 +- ....go => model_handlers_app_config_result.go | 7 +- ...o => model_handlers_chain_config_params.go | 9 +- ...o => model_handlers_chain_config_result.go | 9 +- ..._handlers_chain_send_trx_rule_list_item.go | 15 +- ...> model_handlers_clear_group_data_param.go | 9 +- ... model_handlers_clear_group_data_result.go | 3 +- ...go => model_handlers_create_group_param.go | 10 +- ...o => model_handlers_create_group_result.go | 6 +- ...=> model_handlers_get_group_seed_result.go | 3 +- ...go => model_handlers_group_network_info.go | 9 +- ...go => model_handlers_grp_producer_param.go | 10 +- ...o => model_handlers_grp_producer_result.go | 15 +- ...o => model_handlers_join_group_param_v2.go | 2 +- ....go => model_handlers_leave_group_param.go | 3 +- ...go => model_handlers_leave_group_result.go | 3 +- model_handlers_network_info.go | 21 + model_handlers_node_info.go | 21 + model_handlers_node_info_mem.go | 26 + model_handlers_post_to_group_param.go | 16 + ...go => model_handlers_producer_list_item.go | 11 +- ...item.go => model_handlers_trx_auth_item.go | 5 +- ..._result.go => model_handlers_trx_result.go | 3 +- model_options_jwt.go | 16 + model_options_jwt_list_item.go | 15 + ...ng_param.go => model_options_token_item.go | 10 +- model_pb_announce_item.go | 24 + model_pb_block.go | 23 + model_pb_producer_item.go | 21 + model_pb_trx.go | 24 + ...aram.go => model_utils_success_response.go | 9 +- node.go | 65 - node_test.go | 163 --- response.go | 46 + tools.go | 18 - user.go | 67 - 108 files changed, 5918 insertions(+), 1489 deletions(-) create mode 100644 .gitignore delete mode 100644 api.go create mode 100644 api_apps.go create mode 100644 api_chain.go create mode 100644 api_group.go create mode 100644 api_groups.go create mode 100644 api_keystore.go create mode 100644 api_light_node.go create mode 100644 api_management.go create mode 100644 api_node.go create mode 100644 api_tools.go create mode 100644 api_user.go delete mode 100644 apps.go delete mode 100644 chain.go create mode 100644 client.go create mode 100644 configuration.go delete mode 100644 group.go delete mode 100644 groups.go delete mode 100644 keystore.go delete mode 100644 management.go delete mode 100644 model/model_api_addr_proto_pair.go delete mode 100644 model/model_api_group_info.go delete mode 100644 model/model_api_grp_user_result.go delete mode 100644 model/model_api_join_group_result.go delete mode 100644 model/model_api_snapshot_info.go delete mode 100644 model/model_appapi_group_content_object_item.go delete mode 100644 model/model_chain_publish_queue_item.go delete mode 100644 model/model_handlers_group_seed.go delete mode 100644 model/model_handlers_network_info.go delete mode 100644 model/model_handlers_node_info.go delete mode 100644 model/model_handlers_pub_queue_info.go delete mode 100644 model/model_pb_activity.go delete mode 100644 model/model_pb_block.go delete mode 100644 model/model_pb_file.go delete mode 100644 model/model_pb_image.go delete mode 100644 model/model_pb_link.go delete mode 100644 model/model_pb_object.go delete mode 100644 model/model_pb_payment.go delete mode 100644 model/model_pb_person.go delete mode 100644 model/model_pb_reply.go delete mode 100644 model/model_pb_trx.go delete mode 100644 model/model_timestamppb_timestamp.go rename model/model_api_add_relay_servers_resp.go => model_api_add_relay_servers_resp.go (95%) create mode 100644 model_api_get_user_encrypt_pub_keys_result.go create mode 100644 model_api_group_info.go rename model/model_api_group_info_list.go => model_api_group_info_list.go (95%) create mode 100644 model_api_grp_info_node_sdk.go rename model/model_api_grp_user_param.go => model_api_grp_user_param.go (72%) create mode 100644 model_api_grp_user_result.go create mode 100644 model_api_join_group_result.go rename model/model_handlers_ping_resp.go => model_api_n_sdk_announce_params.go (60%) create mode 100644 model_api_n_sdk_send_trx_params.go rename model/model_api_pubkey_param.go => model_api_pubkey_param.go (95%) rename model/model_api_pub_queue_ack_payload.go => model_api_pubkey_to_ethaddr_result.go (58%) rename model/model_handlers_update_profile_result.go => model_api_send_trx_result.go (66%) rename model/model_api_sign_tx_param.go => model_api_sign_tx_param.go (77%) rename model/model_api_sign_tx_result.go => model_api_sign_tx_result.go (95%) rename model/model_api_start_sync_result.go => model_api_start_sync_result.go (85%) rename model/model_appapi_create_jwt_params.go => model_appapi_create_jwt_params.go (63%) create mode 100644 model_appapi_revoke_jwt_params.go rename model/model_appapi_token_item.go => model_appapi_token_item.go (95%) create mode 100644 model_def_rex_sync_result.go rename model/model_handlers_add_peer_result.go => model_handlers_add_peer_result.go (53%) rename model/model_handlers_announce_param.go => model_handlers_announce_param.go (75%) rename model/model_handlers_announce_result.go => model_handlers_announce_result.go (60%) rename model/model_handlers_announced_producer_list_item.go => model_handlers_announced_producer_list_item.go (56%) rename model/model_handlers_announced_user_list_item.go => model_handlers_announced_user_list_item.go (56%) rename model/model_handlers_app_config_key_item.go => model_handlers_app_config_key_item.go (56%) rename model/model_handlers_app_config_key_list_item.go => model_handlers_app_config_key_list_item.go (96%) rename model/model_handlers_app_config_param.go => model_handlers_app_config_param.go (66%) rename model/model_handlers_app_config_result.go => model_handlers_app_config_result.go (80%) rename model/model_handlers_chain_config_params.go => model_handlers_chain_config_params.go (75%) rename model/model_handlers_chain_config_result.go => model_handlers_chain_config_result.go (74%) rename model/model_handlers_chain_send_trx_rule_list_item.go => model_handlers_chain_send_trx_rule_list_item.go (53%) rename model/model_appapi_sender_list.go => model_handlers_clear_group_data_param.go (57%) rename model/model_handlers_clear_group_data_result.go => model_handlers_clear_group_data_result.go (95%) rename model/model_handlers_create_group_param.go => model_handlers_create_group_param.go (66%) rename model/model_handlers_create_group_result.go => model_handlers_create_group_result.go (86%) rename model/model_handlers_get_group_seed_result.go => model_handlers_get_group_seed_result.go (95%) rename model/model_handlers_group_network_info.go => model_handlers_group_network_info.go (72%) rename model/model_handlers_grp_producer_param.go => model_handlers_grp_producer_param.go (63%) rename model/model_handlers_grp_producer_result.go => model_handlers_grp_producer_result.go (51%) rename model/model_handlers_join_group_param_v2.go => model_handlers_join_group_param_v2.go (95%) rename model/model_handlers_leave_group_param.go => model_handlers_leave_group_param.go (95%) rename model/model_handlers_leave_group_result.go => model_handlers_leave_group_result.go (95%) create mode 100644 model_handlers_network_info.go create mode 100644 model_handlers_node_info.go create mode 100644 model_handlers_node_info_mem.go create mode 100644 model_handlers_post_to_group_param.go rename model/model_handlers_producer_list_item.go => model_handlers_producer_list_item.go (62%) rename model/model_handlers_trx_auth_item.go => model_handlers_trx_auth_item.go (85%) rename model/model_handlers_trx_result.go => model_handlers_trx_result.go (95%) create mode 100644 model_options_jwt.go create mode 100644 model_options_jwt_list_item.go rename model/model_api_ps_ping_param.go => model_options_token_item.go (56%) create mode 100644 model_pb_announce_item.go create mode 100644 model_pb_block.go create mode 100644 model_pb_producer_item.go create mode 100644 model_pb_trx.go rename model/model_api_p2_p_ping_param.go => model_utils_success_response.go (60%) delete mode 100644 node.go delete mode 100644 node_test.go create mode 100644 response.go delete mode 100644 tools.go delete mode 100644 user.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..09e9686 --- /dev/null +++ b/.gitignore @@ -0,0 +1,37 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof + +.vscode +.openapi-generator-ignore +.openapi-generator + +git_push.sh + +.travis.yml + +docs/* +api/* + +.DS_Store \ No newline at end of file diff --git a/README.md b/README.md index 4b413d1..c38c888 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Rum System is flexable communicating protocol. You can treat it like well-backup # Usage install: `go get github.com/tymon42/rum-go-sdk` -``` + + + + + + diff --git a/api.go b/api.go deleted file mode 100644 index 42e5734..0000000 --- a/api.go +++ /dev/null @@ -1,29 +0,0 @@ -package rumgosdk - -import ( - "strings" - - "github.com/go-resty/resty/v2" -) - -type Quorum struct { - ApiServer string - HttpClient *resty.Client -} - -// Connect a new Quorum instance -func Connect(apiServer string) *Quorum { - ApiServer := apiServer - if len(apiServer) > 0 { - if strings.HasPrefix(apiServer, "https") || strings.HasPrefix(apiServer, "http") { - ApiServer = apiServer - } else { - ApiServer = "https://" + apiServer - } - } - - return &Quorum{ - ApiServer: ApiServer, - HttpClient: resty.New(), - } -} diff --git a/api_apps.go b/api_apps.go new file mode 100644 index 0000000..ce24d3d --- /dev/null +++ b/api_apps.go @@ -0,0 +1,575 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" + "github.com/antihax/optional" + "reflect" +) + +// Linger please +var ( + _ _context.Context +) + +// AppsApiService AppsApi service +type AppsApiService service + +// AppsApiAppApiV1GroupGroupIdContentGetOpts Optional parameters for the method 'AppApiV1GroupGroupIdContentGet' +type AppsApiAppApiV1GroupGroupIdContentGetOpts struct { + IncludeStartTrx optional.String + Num optional.Int32 + Reverse optional.String + Senders optional.Interface + StartTrx optional.String +} + +/* +AppApiV1GroupGroupIdContentGet GetGroupContents +Get contents in a group + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id + * @param groupId2 + * @param optional nil or *AppsApiAppApiV1GroupGroupIdContentGetOpts - Optional Parameters: + * @param "IncludeStartTrx" (optional.String) - + * @param "Num" (optional.Int32) - + * @param "Reverse" (optional.String) - + * @param "Senders" (optional.Interface of []string) - + * @param "StartTrx" (optional.String) - +@return [][]PbTrx +*/ +func (a *AppsApiService) AppApiV1GroupGroupIdContentGet(ctx _context.Context, groupId string, groupId2 string, localVarOptionals *AppsApiAppApiV1GroupGroupIdContentGetOpts) ([][]PbTrx, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue [][]PbTrx + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/app/api/v1/group/{group_id}/content" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + localVarQueryParams.Add("group_id", parameterToString(groupId2, "")) + if localVarOptionals != nil && localVarOptionals.IncludeStartTrx.IsSet() { + localVarQueryParams.Add("include_start_trx", parameterToString(localVarOptionals.IncludeStartTrx.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Num.IsSet() { + localVarQueryParams.Add("num", parameterToString(localVarOptionals.Num.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Reverse.IsSet() { + localVarQueryParams.Add("reverse", parameterToString(localVarOptionals.Reverse.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Senders.IsSet() { + t:=localVarOptionals.Senders.Value() + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("senders", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("senders", parameterToString(t, "multi")) + } + } + if localVarOptionals != nil && localVarOptionals.StartTrx.IsSet() { + localVarQueryParams.Add("start_trx", parameterToString(localVarOptionals.StartTrx.Value(), "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// AppsApiAppApiV1TokenDeleteOpts Optional parameters for the method 'AppApiV1TokenDelete' +type AppsApiAppApiV1TokenDeleteOpts struct { + GroupId optional.String +} + +/* +AppApiV1TokenDelete RemoveToken +Remove a auth token + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param role + * @param token + * @param authorization current auth token + * @param optional nil or *AppsApiAppApiV1TokenDeleteOpts - Optional Parameters: + * @param "GroupId" (optional.String) - +@return UtilsSuccessResponse +*/ +func (a *AppsApiService) AppApiV1TokenDelete(ctx _context.Context, role string, token string, authorization string, localVarOptionals *AppsApiAppApiV1TokenDeleteOpts) (UtilsSuccessResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue UtilsSuccessResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/app/api/v1/token" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if localVarOptionals != nil && localVarOptionals.GroupId.IsSet() { + localVarQueryParams.Add("group_id", parameterToString(localVarOptionals.GroupId.Value(), "")) + } + localVarQueryParams.Add("role", parameterToString(role, "")) + localVarQueryParams.Add("token", parameterToString(token, "")) + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + localVarHeaderParams["Authorization"] = parameterToString(authorization, "") + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +AppApiV1TokenListGet ListToken +List all auth token + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param authorization current auth token +@return OptionsJwt +*/ +func (a *AppsApiService) AppApiV1TokenListGet(ctx _context.Context, authorization string) (OptionsJwt, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue OptionsJwt + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/app/api/v1/token/list" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + localVarHeaderParams["Authorization"] = parameterToString(authorization, "") + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// AppsApiAppApiV1TokenPostOpts Optional parameters for the method 'AppApiV1TokenPost' +type AppsApiAppApiV1TokenPostOpts struct { + AppapiCreateJwtParams optional.Interface +} + +/* +AppApiV1TokenPost CreateToken +Create a new auth token, only allow access from localhost + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *AppsApiAppApiV1TokenPostOpts - Optional Parameters: + * @param "AppapiCreateJwtParams" (optional.Interface of AppapiCreateJwtParams) - +@return AppapiTokenItem +*/ +func (a *AppsApiService) AppApiV1TokenPost(ctx _context.Context, localVarOptionals *AppsApiAppApiV1TokenPostOpts) (AppapiTokenItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AppapiTokenItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/app/api/v1/token" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.AppapiCreateJwtParams.IsSet() { + localVarOptionalAppapiCreateJwtParams, localVarOptionalAppapiCreateJwtParamsok := localVarOptionals.AppapiCreateJwtParams.Value().(AppapiCreateJwtParams) + if !localVarOptionalAppapiCreateJwtParamsok { + return localVarReturnValue, nil, reportError("appapiCreateJwtParams should be AppapiCreateJwtParams") + } + localVarPostBody = &localVarOptionalAppapiCreateJwtParams + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +AppApiV1TokenRefreshPost RefreshToken +Get a new auth token + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param authorization current auth token +@return AppapiTokenItem +*/ +func (a *AppsApiService) AppApiV1TokenRefreshPost(ctx _context.Context, authorization string) (AppapiTokenItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AppapiTokenItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/app/api/v1/token/refresh" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + localVarHeaderParams["Authorization"] = parameterToString(authorization, "") + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// AppsApiAppApiV1TokenRevokePostOpts Optional parameters for the method 'AppApiV1TokenRevokePost' +type AppsApiAppApiV1TokenRevokePostOpts struct { + AppapiRevokeJwtParams optional.Interface +} + +/* +AppApiV1TokenRevokePost RevokeToken +Revoke a auth token + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param authorization current auth token + * @param optional nil or *AppsApiAppApiV1TokenRevokePostOpts - Optional Parameters: + * @param "AppapiRevokeJwtParams" (optional.Interface of AppapiRevokeJwtParams) - +@return UtilsSuccessResponse +*/ +func (a *AppsApiService) AppApiV1TokenRevokePost(ctx _context.Context, authorization string, localVarOptionals *AppsApiAppApiV1TokenRevokePostOpts) (UtilsSuccessResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue UtilsSuccessResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/app/api/v1/token/revoke" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + localVarHeaderParams["Authorization"] = parameterToString(authorization, "") + // body params + if localVarOptionals != nil && localVarOptionals.AppapiRevokeJwtParams.IsSet() { + localVarOptionalAppapiRevokeJwtParams, localVarOptionalAppapiRevokeJwtParamsok := localVarOptionals.AppapiRevokeJwtParams.Value().(AppapiRevokeJwtParams) + if !localVarOptionalAppapiRevokeJwtParamsok { + return localVarReturnValue, nil, reportError("appapiRevokeJwtParams should be AppapiRevokeJwtParams") + } + localVarPostBody = &localVarOptionalAppapiRevokeJwtParams + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_chain.go b/api_chain.go new file mode 100644 index 0000000..a6625eb --- /dev/null +++ b/api_chain.go @@ -0,0 +1,191 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// ChainApiService ChainApi service +type ChainApiService service + +/* +ApiV1BlockGroupIdEpochGet GetBlock +Get a block from a group + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id + * @param blockId Epoch + * @param epoch +@return PbBlock +*/ +func (a *ChainApiService) ApiV1BlockGroupIdEpochGet(ctx _context.Context, groupId string, blockId string, epoch string) (PbBlock, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PbBlock + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/block/{group_id}/{epoch}" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarPath = strings.Replace(localVarPath, "{"+"block_id"+"}", _neturl.QueryEscape(parameterToString(blockId, "")) , -1) + + localVarPath = strings.Replace(localVarPath, "{"+"epoch"+"}", _neturl.QueryEscape(parameterToString(epoch, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1TrxGroupIdTrxIdGet GetTrx +Get a transaction a group + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id + * @param trxId Transaction Id +@return PbTrx +*/ +func (a *ChainApiService) ApiV1TrxGroupIdTrxIdGet(ctx _context.Context, groupId string, trxId string) (PbTrx, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PbTrx + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/trx/{group_id}/{trx_id}" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarPath = strings.Replace(localVarPath, "{"+"trx_id"+"}", _neturl.QueryEscape(parameterToString(trxId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_group.go b/api_group.go new file mode 100644 index 0000000..da812eb --- /dev/null +++ b/api_group.go @@ -0,0 +1,104 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// GroupApiService GroupApi service +type GroupApiService service + +/* +ApiV1GroupGroupIdStartsyncPost StartSync +Start sync + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id +@return ApiStartSyncResult +*/ +func (a *GroupApiService) ApiV1GroupGroupIdStartsyncPost(ctx _context.Context, groupId string) (ApiStartSyncResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ApiStartSyncResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/{group_id}/startsync" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_groups.go b/api_groups.go new file mode 100644 index 0000000..e91299b --- /dev/null +++ b/api_groups.go @@ -0,0 +1,726 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ _context.Context +) + +// GroupsApiService GroupsApi service +type GroupsApiService service + +// GroupsApiApiV1GroupClearPostOpts Optional parameters for the method 'ApiV1GroupClearPost' +type GroupsApiApiV1GroupClearPostOpts struct { + HandlersClearGroupDataParam optional.Interface +} + +/* +ApiV1GroupClearPost ClearGroupData +Clear group data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GroupsApiApiV1GroupClearPostOpts - Optional Parameters: + * @param "HandlersClearGroupDataParam" (optional.Interface of HandlersClearGroupDataParam) - +@return HandlersClearGroupDataResult +*/ +func (a *GroupsApiService) ApiV1GroupClearPost(ctx _context.Context, localVarOptionals *GroupsApiApiV1GroupClearPostOpts) (HandlersClearGroupDataResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HandlersClearGroupDataResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/clear" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.HandlersClearGroupDataParam.IsSet() { + localVarOptionalHandlersClearGroupDataParam, localVarOptionalHandlersClearGroupDataParamok := localVarOptionals.HandlersClearGroupDataParam.Value().(HandlersClearGroupDataParam) + if !localVarOptionalHandlersClearGroupDataParamok { + return localVarReturnValue, nil, reportError("handlersClearGroupDataParam should be HandlersClearGroupDataParam") + } + localVarPostBody = &localVarOptionalHandlersClearGroupDataParam + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GroupsApiApiV1GroupGroupIdContentPostOpts Optional parameters for the method 'ApiV1GroupGroupIdContentPost' +type GroupsApiApiV1GroupGroupIdContentPostOpts struct { + HandlersPostToGroupParam optional.Interface +} + +/* +ApiV1GroupGroupIdContentPost PostToGroup +Post object to a group + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id + * @param optional nil or *GroupsApiApiV1GroupGroupIdContentPostOpts - Optional Parameters: + * @param "HandlersPostToGroupParam" (optional.Interface of HandlersPostToGroupParam) - +@return HandlersTrxResult +*/ +func (a *GroupsApiService) ApiV1GroupGroupIdContentPost(ctx _context.Context, groupId string, localVarOptionals *GroupsApiApiV1GroupGroupIdContentPostOpts) (HandlersTrxResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HandlersTrxResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/{group_id}/content" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.HandlersPostToGroupParam.IsSet() { + localVarOptionalHandlersPostToGroupParam, localVarOptionalHandlersPostToGroupParamok := localVarOptionals.HandlersPostToGroupParam.Value().(HandlersPostToGroupParam) + if !localVarOptionalHandlersPostToGroupParamok { + return localVarReturnValue, nil, reportError("handlersPostToGroupParam should be HandlersPostToGroupParam") + } + localVarPostBody = &localVarOptionalHandlersPostToGroupParam + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1GroupGroupIdGet GetGroupById +Get the joined group by group id + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id +@return ApiGroupInfo +*/ +func (a *GroupsApiService) ApiV1GroupGroupIdGet(ctx _context.Context, groupId string) (ApiGroupInfo, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ApiGroupInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/{group_id}" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GroupsApiApiV1GroupGroupIdSeedGetOpts Optional parameters for the method 'ApiV1GroupGroupIdSeedGet' +type GroupsApiApiV1GroupGroupIdSeedGetOpts struct { + IncludeChainUrl optional.String +} + +/* +ApiV1GroupGroupIdSeedGet Get group seed +get group seed from appdb + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id + * @param optional nil or *GroupsApiApiV1GroupGroupIdSeedGetOpts - Optional Parameters: + * @param "IncludeChainUrl" (optional.String) - if include chain url +@return HandlersGetGroupSeedResult +*/ +func (a *GroupsApiService) ApiV1GroupGroupIdSeedGet(ctx _context.Context, groupId string, localVarOptionals *GroupsApiApiV1GroupGroupIdSeedGetOpts) (HandlersGetGroupSeedResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HandlersGetGroupSeedResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/{group_id}/seed" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if localVarOptionals != nil && localVarOptionals.IncludeChainUrl.IsSet() { + localVarQueryParams.Add("include_chain_url", parameterToString(localVarOptionals.IncludeChainUrl.Value(), "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GroupsApiApiV1GroupLeavePostOpts Optional parameters for the method 'ApiV1GroupLeavePost' +type GroupsApiApiV1GroupLeavePostOpts struct { + HandlersLeaveGroupParam optional.Interface +} + +/* +ApiV1GroupLeavePost LeaveGroup +Leave a new group + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GroupsApiApiV1GroupLeavePostOpts - Optional Parameters: + * @param "HandlersLeaveGroupParam" (optional.Interface of HandlersLeaveGroupParam) - +@return HandlersLeaveGroupResult +*/ +func (a *GroupsApiService) ApiV1GroupLeavePost(ctx _context.Context, localVarOptionals *GroupsApiApiV1GroupLeavePostOpts) (HandlersLeaveGroupResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HandlersLeaveGroupResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/leave" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.HandlersLeaveGroupParam.IsSet() { + localVarOptionalHandlersLeaveGroupParam, localVarOptionalHandlersLeaveGroupParamok := localVarOptionals.HandlersLeaveGroupParam.Value().(HandlersLeaveGroupParam) + if !localVarOptionalHandlersLeaveGroupParamok { + return localVarReturnValue, nil, reportError("handlersLeaveGroupParam should be HandlersLeaveGroupParam") + } + localVarPostBody = &localVarOptionalHandlersLeaveGroupParam + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GroupsApiApiV1GroupPostOpts Optional parameters for the method 'ApiV1GroupPost' +type GroupsApiApiV1GroupPostOpts struct { + HandlersCreateGroupParam optional.Interface +} + +/* +ApiV1GroupPost CreateGroupUrl +Create a new group + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GroupsApiApiV1GroupPostOpts - Optional Parameters: + * @param "HandlersCreateGroupParam" (optional.Interface of HandlersCreateGroupParam) - +@return HandlersCreateGroupResult +*/ +func (a *GroupsApiService) ApiV1GroupPost(ctx _context.Context, localVarOptionals *GroupsApiApiV1GroupPostOpts) (HandlersCreateGroupResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HandlersCreateGroupResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.HandlersCreateGroupParam.IsSet() { + localVarOptionalHandlersCreateGroupParam, localVarOptionalHandlersCreateGroupParamok := localVarOptionals.HandlersCreateGroupParam.Value().(HandlersCreateGroupParam) + if !localVarOptionalHandlersCreateGroupParamok { + return localVarReturnValue, nil, reportError("handlersCreateGroupParam should be HandlersCreateGroupParam") + } + localVarPostBody = &localVarOptionalHandlersCreateGroupParam + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1GroupsGet GetGroups +Get all joined groups + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return ApiGroupInfoList +*/ +func (a *GroupsApiService) ApiV1GroupsGet(ctx _context.Context) (ApiGroupInfoList, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ApiGroupInfoList + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/groups" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GroupsApiApiV2GroupJoinPostOpts Optional parameters for the method 'ApiV2GroupJoinPost' +type GroupsApiApiV2GroupJoinPostOpts struct { + HandlersJoinGroupParamV2 optional.Interface +} + +/* +ApiV2GroupJoinPost JoinGroup +Join a group + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GroupsApiApiV2GroupJoinPostOpts - Optional Parameters: + * @param "HandlersJoinGroupParamV2" (optional.Interface of HandlersJoinGroupParamV2) - +@return ApiJoinGroupResult +*/ +func (a *GroupsApiService) ApiV2GroupJoinPost(ctx _context.Context, localVarOptionals *GroupsApiApiV2GroupJoinPostOpts) (ApiJoinGroupResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ApiJoinGroupResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v2/group/join" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.HandlersJoinGroupParamV2.IsSet() { + localVarOptionalHandlersJoinGroupParamV2, localVarOptionalHandlersJoinGroupParamV2ok := localVarOptionals.HandlersJoinGroupParamV2.Value().(HandlersJoinGroupParamV2) + if !localVarOptionalHandlersJoinGroupParamV2ok { + return localVarReturnValue, nil, reportError("handlersJoinGroupParamV2 should be HandlersJoinGroupParamV2") + } + localVarPostBody = &localVarOptionalHandlersJoinGroupParamV2 + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_keystore.go b/api_keystore.go new file mode 100644 index 0000000..3c1942f --- /dev/null +++ b/api_keystore.go @@ -0,0 +1,117 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ _context.Context +) + +// KeystoreApiService KeystoreApi service +type KeystoreApiService service + +// KeystoreApiApiV1KeystoreSigntxPostOpts Optional parameters for the method 'ApiV1KeystoreSigntxPost' +type KeystoreApiApiV1KeystoreSigntxPostOpts struct { + ApiSignTxParam optional.Interface +} + +/* +ApiV1KeystoreSigntxPost SignTx +signature transaction with key name or key alias + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *KeystoreApiApiV1KeystoreSigntxPostOpts - Optional Parameters: + * @param "ApiSignTxParam" (optional.Interface of ApiSignTxParam) - +@return ApiSignTxResult +*/ +func (a *KeystoreApiService) ApiV1KeystoreSigntxPost(ctx _context.Context, localVarOptionals *KeystoreApiApiV1KeystoreSigntxPostOpts) (ApiSignTxResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ApiSignTxResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/keystore/signtx" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.ApiSignTxParam.IsSet() { + localVarOptionalApiSignTxParam, localVarOptionalApiSignTxParamok := localVarOptionals.ApiSignTxParam.Value().(ApiSignTxParam) + if !localVarOptionalApiSignTxParamok { + return localVarReturnValue, nil, reportError("apiSignTxParam should be ApiSignTxParam") + } + localVarPostBody = &localVarOptionalApiSignTxParam + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_light_node.go b/api_light_node.go new file mode 100644 index 0000000..aabf750 --- /dev/null +++ b/api_light_node.go @@ -0,0 +1,1130 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" + "github.com/antihax/optional" + "reflect" +) + +// Linger please +var ( + _ _context.Context +) + +// LightNodeApiService LightNodeApi service +type LightNodeApiService service + +// LightNodeApiApiV1NodeGroupIdAnnouncePostOpts Optional parameters for the method 'ApiV1NodeGroupIdAnnouncePost' +type LightNodeApiApiV1NodeGroupIdAnnouncePostOpts struct { + ApiNSdkAnnounceParams optional.Interface +} + +/* +ApiV1NodeGroupIdAnnouncePost NSdkAnnounce +Announce User's encryption Pubkey to the group for light node + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id + * @param optional nil or *LightNodeApiApiV1NodeGroupIdAnnouncePostOpts - Optional Parameters: + * @param "ApiNSdkAnnounceParams" (optional.Interface of ApiNSdkAnnounceParams) - +@return HandlersAnnounceResult +*/ +func (a *LightNodeApiService) ApiV1NodeGroupIdAnnouncePost(ctx _context.Context, groupId string, localVarOptionals *LightNodeApiApiV1NodeGroupIdAnnouncePostOpts) (HandlersAnnounceResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HandlersAnnounceResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/node/{group_id}/announce" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.ApiNSdkAnnounceParams.IsSet() { + localVarOptionalApiNSdkAnnounceParams, localVarOptionalApiNSdkAnnounceParamsok := localVarOptionals.ApiNSdkAnnounceParams.Value().(ApiNSdkAnnounceParams) + if !localVarOptionalApiNSdkAnnounceParamsok { + return localVarReturnValue, nil, reportError("apiNSdkAnnounceParams should be ApiNSdkAnnounceParams") + } + localVarPostBody = &localVarOptionalApiNSdkAnnounceParams + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1NodeGroupIdAnnouncedProducerGet GetNSdkAnnouncedProducer +get announced producer from chain data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id +@return []HandlersAppConfigKeyItem +*/ +func (a *LightNodeApiService) ApiV1NodeGroupIdAnnouncedProducerGet(ctx _context.Context, groupId string) ([]HandlersAppConfigKeyItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []HandlersAppConfigKeyItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/node/{group_id}/announced/producer" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// LightNodeApiApiV1NodeGroupIdAnnouncedUserGetOpts Optional parameters for the method 'ApiV1NodeGroupIdAnnouncedUserGet' +type LightNodeApiApiV1NodeGroupIdAnnouncedUserGetOpts struct { + Pubkey optional.String +} + +/* +ApiV1NodeGroupIdAnnouncedUserGet GetNSdkAnnouncedUser +get announced user from chain data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id + * @param optional nil or *LightNodeApiApiV1NodeGroupIdAnnouncedUserGetOpts - Optional Parameters: + * @param "Pubkey" (optional.String) - +@return []HandlersAnnouncedUserListItem +*/ +func (a *LightNodeApiService) ApiV1NodeGroupIdAnnouncedUserGet(ctx _context.Context, groupId string, localVarOptionals *LightNodeApiApiV1NodeGroupIdAnnouncedUserGetOpts) ([]HandlersAnnouncedUserListItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []HandlersAnnouncedUserListItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/node/{group_id}/announced/user" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if localVarOptionals != nil && localVarOptionals.Pubkey.IsSet() { + localVarQueryParams.Add("pubkey", parameterToString(localVarOptionals.Pubkey.Value(), "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1NodeGroupIdAppconfigByKeyGet GetNSdkAppconfigByKey +get app config by key from chain data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id + * @param key key name +@return []HandlersAppConfigKeyItem +*/ +func (a *LightNodeApiService) ApiV1NodeGroupIdAppconfigByKeyGet(ctx _context.Context, groupId string, key string) ([]HandlersAppConfigKeyItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []HandlersAppConfigKeyItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/node/{group_id}/appconfig/by/{key}" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", _neturl.QueryEscape(parameterToString(key, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1NodeGroupIdAppconfigKeylistGet GetNSdkAppconfigKeylist +get app config key list from chain data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id +@return []HandlersAppConfigKeyListItem +*/ +func (a *LightNodeApiService) ApiV1NodeGroupIdAppconfigKeylistGet(ctx _context.Context, groupId string) ([]HandlersAppConfigKeyListItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []HandlersAppConfigKeyListItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/node/{group_id}/appconfig/keylist" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1NodeGroupIdAuthAlwlistGet GetNSdkAllowList +get allow list from chain data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id +@return []HandlersChainSendTrxRuleListItem +*/ +func (a *LightNodeApiService) ApiV1NodeGroupIdAuthAlwlistGet(ctx _context.Context, groupId string) ([]HandlersChainSendTrxRuleListItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []HandlersChainSendTrxRuleListItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/node/{group_id}/auth/alwlist" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1NodeGroupIdAuthByTrxTypeGet GetNSdkAuthType +get auth type from chain data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id + * @param trxType trx type +@return HandlersTrxAuthItem +*/ +func (a *LightNodeApiService) ApiV1NodeGroupIdAuthByTrxTypeGet(ctx _context.Context, groupId string, trxType string) (HandlersTrxAuthItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HandlersTrxAuthItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/node/{group_id}/auth/by/{trx_type}" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarPath = strings.Replace(localVarPath, "{"+"trx_type"+"}", _neturl.QueryEscape(parameterToString(trxType, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1NodeGroupIdAuthDenylistGet GetNSdkDenyList +get deny list from chain data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id +@return []HandlersChainSendTrxRuleListItem +*/ +func (a *LightNodeApiService) ApiV1NodeGroupIdAuthDenylistGet(ctx _context.Context, groupId string) ([]HandlersChainSendTrxRuleListItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []HandlersChainSendTrxRuleListItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/node/{group_id}/auth/denylist" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// LightNodeApiApiV1NodeGroupIdGroupctnGetOpts Optional parameters for the method 'ApiV1NodeGroupIdGroupctnGet' +type LightNodeApiApiV1NodeGroupIdGroupctnGetOpts struct { + IncludeStartTrx optional.String + Num optional.Int32 + Reverse optional.String + Senders optional.Interface + StartTrx optional.String +} + +/* +ApiV1NodeGroupIdGroupctnGet GetNSdkContent +get content + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id + * @param groupId2 + * @param optional nil or *LightNodeApiApiV1NodeGroupIdGroupctnGetOpts - Optional Parameters: + * @param "IncludeStartTrx" (optional.String) - + * @param "Num" (optional.Int32) - + * @param "Reverse" (optional.String) - + * @param "Senders" (optional.Interface of []string) - + * @param "StartTrx" (optional.String) - +@return []PbTrx +*/ +func (a *LightNodeApiService) ApiV1NodeGroupIdGroupctnGet(ctx _context.Context, groupId string, groupId2 string, localVarOptionals *LightNodeApiApiV1NodeGroupIdGroupctnGetOpts) ([]PbTrx, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []PbTrx + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/node/{group_id}/groupctn" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + localVarQueryParams.Add("group_id", parameterToString(groupId2, "")) + if localVarOptionals != nil && localVarOptionals.IncludeStartTrx.IsSet() { + localVarQueryParams.Add("include_start_trx", parameterToString(localVarOptionals.IncludeStartTrx.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Num.IsSet() { + localVarQueryParams.Add("num", parameterToString(localVarOptionals.Num.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Reverse.IsSet() { + localVarQueryParams.Add("reverse", parameterToString(localVarOptionals.Reverse.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Senders.IsSet() { + t:=localVarOptionals.Senders.Value() + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("senders", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("senders", parameterToString(t, "multi")) + } + } + if localVarOptionals != nil && localVarOptionals.StartTrx.IsSet() { + localVarQueryParams.Add("start_trx", parameterToString(localVarOptionals.StartTrx.Value(), "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1NodeGroupIdInfoGet GetNSdkGroupInfo +get group info from chain data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id +@return []ApiGrpInfoNodeSdk +*/ +func (a *LightNodeApiService) ApiV1NodeGroupIdInfoGet(ctx _context.Context, groupId string) ([]ApiGrpInfoNodeSdk, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []ApiGrpInfoNodeSdk + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/node/{group_id}/info" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1NodeGroupIdProducersGet GetNSdkGroupProducers +get group producers from chain data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id +@return []HandlersProducerListItem +*/ +func (a *LightNodeApiService) ApiV1NodeGroupIdProducersGet(ctx _context.Context, groupId string) ([]HandlersProducerListItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []HandlersProducerListItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/node/{group_id}/producers" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// LightNodeApiApiV1NodeGroupIdTrxPostOpts Optional parameters for the method 'ApiV1NodeGroupIdTrxPost' +type LightNodeApiApiV1NodeGroupIdTrxPostOpts struct { + ApiNSdkSendTrxParams optional.Interface +} + +/* +ApiV1NodeGroupIdTrxPost NSdkSendTrx +send trx + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id + * @param optional nil or *LightNodeApiApiV1NodeGroupIdTrxPostOpts - Optional Parameters: + * @param "ApiNSdkSendTrxParams" (optional.Interface of ApiNSdkSendTrxParams) - +@return ApiSendTrxResult +*/ +func (a *LightNodeApiService) ApiV1NodeGroupIdTrxPost(ctx _context.Context, groupId string, localVarOptionals *LightNodeApiApiV1NodeGroupIdTrxPostOpts) (ApiSendTrxResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ApiSendTrxResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/node/{group_id}/trx" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.ApiNSdkSendTrxParams.IsSet() { + localVarOptionalApiNSdkSendTrxParams, localVarOptionalApiNSdkSendTrxParamsok := localVarOptionals.ApiNSdkSendTrxParams.Value().(ApiNSdkSendTrxParams) + if !localVarOptionalApiNSdkSendTrxParamsok { + return localVarReturnValue, nil, reportError("apiNSdkSendTrxParams should be ApiNSdkSendTrxParams") + } + localVarPostBody = &localVarOptionalApiNSdkSendTrxParams + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1NodeGroupIdUserencryptpubkeysGet GetNSdkUserEncryptPubKeys +get user encrypt pub keys + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id +@return ApiGetUserEncryptPubKeysResult +*/ +func (a *LightNodeApiService) ApiV1NodeGroupIdUserencryptpubkeysGet(ctx _context.Context, groupId string) (ApiGetUserEncryptPubKeysResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ApiGetUserEncryptPubKeysResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/node/{group_id}/userencryptpubkeys" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_management.go b/api_management.go new file mode 100644 index 0000000..fbb2361 --- /dev/null +++ b/api_management.go @@ -0,0 +1,865 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ _context.Context +) + +// ManagementApiService ManagementApi service +type ManagementApiService service + +// ManagementApiApiV1GroupAppconfigPostOpts Optional parameters for the method 'ApiV1GroupAppconfigPost' +type ManagementApiApiV1GroupAppconfigPostOpts struct { + HandlersAppConfigParam optional.Interface +} + +/* +ApiV1GroupAppconfigPost MgrAppConfig +set app config + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *ManagementApiApiV1GroupAppconfigPostOpts - Optional Parameters: + * @param "HandlersAppConfigParam" (optional.Interface of HandlersAppConfigParam) - +@return HandlersAppConfigResult +*/ +func (a *ManagementApiService) ApiV1GroupAppconfigPost(ctx _context.Context, localVarOptionals *ManagementApiApiV1GroupAppconfigPostOpts) (HandlersAppConfigResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HandlersAppConfigResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/appconfig" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.HandlersAppConfigParam.IsSet() { + localVarOptionalHandlersAppConfigParam, localVarOptionalHandlersAppConfigParamok := localVarOptionals.HandlersAppConfigParam.Value().(HandlersAppConfigParam) + if !localVarOptionalHandlersAppConfigParamok { + return localVarReturnValue, nil, reportError("handlersAppConfigParam should be HandlersAppConfigParam") + } + localVarPostBody = &localVarOptionalHandlersAppConfigParam + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ManagementApiApiV1GroupChainconfigPostOpts Optional parameters for the method 'ApiV1GroupChainconfigPost' +type ManagementApiApiV1GroupChainconfigPostOpts struct { + HandlersChainConfigParams optional.Interface +} + +/* +ApiV1GroupChainconfigPost chainconfig +chain config + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *ManagementApiApiV1GroupChainconfigPostOpts - Optional Parameters: + * @param "HandlersChainConfigParams" (optional.Interface of HandlersChainConfigParams) - +@return HandlersChainConfigResult +*/ +func (a *ManagementApiService) ApiV1GroupChainconfigPost(ctx _context.Context, localVarOptionals *ManagementApiApiV1GroupChainconfigPostOpts) (HandlersChainConfigResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HandlersChainConfigResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/chainconfig" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.HandlersChainConfigParams.IsSet() { + localVarOptionalHandlersChainConfigParams, localVarOptionalHandlersChainConfigParamsok := localVarOptionals.HandlersChainConfigParams.Value().(HandlersChainConfigParams) + if !localVarOptionalHandlersChainConfigParamsok { + return localVarReturnValue, nil, reportError("handlersChainConfigParams should be HandlersChainConfigParams") + } + localVarPostBody = &localVarOptionalHandlersChainConfigParams + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1GroupGroupIdAppconfigKeyGet GetAppConfigItem +get app config item + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id + * @param key itemKey +@return HandlersAppConfigKeyItem +*/ +func (a *ManagementApiService) ApiV1GroupGroupIdAppconfigKeyGet(ctx _context.Context, groupId string, key string) (HandlersAppConfigKeyItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HandlersAppConfigKeyItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/{group_id}/appconfig/{key}" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", _neturl.QueryEscape(parameterToString(key, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1GroupGroupIdAppconfigKeylistGet GetAppConfigKey +get app config key list + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id +@return []HandlersAppConfigKeyListItem +*/ +func (a *ManagementApiService) ApiV1GroupGroupIdAppconfigKeylistGet(ctx _context.Context, groupId string) ([]HandlersAppConfigKeyListItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []HandlersAppConfigKeyListItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/{group_id}/appconfig/keylist" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1GroupGroupIdProducersGet GetGroupProducers +Get the list of group producers + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id +@return []HandlersProducerListItem +*/ +func (a *ManagementApiService) ApiV1GroupGroupIdProducersGet(ctx _context.Context, groupId string) ([]HandlersProducerListItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []HandlersProducerListItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/{group_id}/producers" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1GroupGroupIdTrxAllowlistGet GetChainTrxAllowList +Get group allow list + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id +@return []HandlersChainSendTrxRuleListItem +*/ +func (a *ManagementApiService) ApiV1GroupGroupIdTrxAllowlistGet(ctx _context.Context, groupId string) ([]HandlersChainSendTrxRuleListItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []HandlersChainSendTrxRuleListItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/{group_id}/trx/allowlist" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1GroupGroupIdTrxAuthTrxTypeGet GetChainTrxAuthMode +GetChainTrxAuthMode + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id + * @param trxType trxType +@return []HandlersTrxAuthItem +*/ +func (a *ManagementApiService) ApiV1GroupGroupIdTrxAuthTrxTypeGet(ctx _context.Context, groupId string, trxType string) ([]HandlersTrxAuthItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []HandlersTrxAuthItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/{group_id}/trx/auth/{trx_type}" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarPath = strings.Replace(localVarPath, "{"+"trx_type"+"}", _neturl.QueryEscape(parameterToString(trxType, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1GroupGroupIdTrxDenylistGet GetDeniedUserList +Get the list of denied users + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id +@return []HandlersChainSendTrxRuleListItem +*/ +func (a *ManagementApiService) ApiV1GroupGroupIdTrxDenylistGet(ctx _context.Context, groupId string) ([]HandlersChainSendTrxRuleListItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []HandlersChainSendTrxRuleListItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/{group_id}/trx/denylist" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ManagementApiApiV1GroupProducerPostOpts Optional parameters for the method 'ApiV1GroupProducerPost' +type ManagementApiApiV1GroupProducerPostOpts struct { + HandlersGrpProducerParam optional.Interface +} + +/* +ApiV1GroupProducerPost AddProducer +add a peer to the group producer list + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *ManagementApiApiV1GroupProducerPostOpts - Optional Parameters: + * @param "HandlersGrpProducerParam" (optional.Interface of HandlersGrpProducerParam) - +@return HandlersGrpProducerResult +*/ +func (a *ManagementApiService) ApiV1GroupProducerPost(ctx _context.Context, localVarOptionals *ManagementApiApiV1GroupProducerPostOpts) (HandlersGrpProducerResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HandlersGrpProducerResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/producer" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.HandlersGrpProducerParam.IsSet() { + localVarOptionalHandlersGrpProducerParam, localVarOptionalHandlersGrpProducerParamok := localVarOptionals.HandlersGrpProducerParam.Value().(HandlersGrpProducerParam) + if !localVarOptionalHandlersGrpProducerParamok { + return localVarReturnValue, nil, reportError("handlersGrpProducerParam should be HandlersGrpProducerParam") + } + localVarPostBody = &localVarOptionalHandlersGrpProducerParam + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ManagementApiApiV1GroupUserPostOpts Optional parameters for the method 'ApiV1GroupUserPost' +type ManagementApiApiV1GroupUserPostOpts struct { + ApiGrpUserParam optional.Interface +} + +/* +ApiV1GroupUserPost AddUsers +add a user to a private group users list + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *ManagementApiApiV1GroupUserPostOpts - Optional Parameters: + * @param "ApiGrpUserParam" (optional.Interface of ApiGrpUserParam) - +@return ApiGrpUserResult +*/ +func (a *ManagementApiService) ApiV1GroupUserPost(ctx _context.Context, localVarOptionals *ManagementApiApiV1GroupUserPostOpts) (ApiGrpUserResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ApiGrpUserResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/user" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.ApiGrpUserParam.IsSet() { + localVarOptionalApiGrpUserParam, localVarOptionalApiGrpUserParamok := localVarOptionals.ApiGrpUserParam.Value().(ApiGrpUserParam) + if !localVarOptionalApiGrpUserParamok { + return localVarReturnValue, nil, reportError("apiGrpUserParam should be ApiGrpUserParam") + } + localVarPostBody = &localVarOptionalApiGrpUserParam + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_node.go b/api_node.go new file mode 100644 index 0000000..d093438 --- /dev/null +++ b/api_node.go @@ -0,0 +1,357 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ _context.Context +) + +// NodeApiService NodeApi service +type NodeApiService service + +/* +ApiV1NetworkGet GetNetwork +Get node's network information + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return HandlersNetworkInfo +*/ +func (a *NodeApiService) ApiV1NetworkGet(ctx _context.Context) (HandlersNetworkInfo, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HandlersNetworkInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/network" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// NodeApiApiV1NetworkPeersPostOpts Optional parameters for the method 'ApiV1NetworkPeersPost' +type NodeApiApiV1NetworkPeersPostOpts struct { + RequestBody optional.Interface +} + +/* +ApiV1NetworkPeersPost AddPeers +Connect to peers + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *NodeApiApiV1NetworkPeersPostOpts - Optional Parameters: + * @param "RequestBody" (optional.Interface of []string) - +@return HandlersAddPeerResult +*/ +func (a *NodeApiService) ApiV1NetworkPeersPost(ctx _context.Context, localVarOptionals *NodeApiApiV1NetworkPeersPostOpts) (HandlersAddPeerResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HandlersAddPeerResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/network/peers" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.RequestBody.IsSet() { + localVarOptionalRequestBody, localVarOptionalRequestBodyok := localVarOptionals.RequestBody.Value().([]string) + if !localVarOptionalRequestBodyok { + return localVarReturnValue, nil, reportError("requestBody should be []string") + } + localVarPostBody = &localVarOptionalRequestBody + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// NodeApiApiV1NetworkRelayPostOpts Optional parameters for the method 'ApiV1NetworkRelayPost' +type NodeApiApiV1NetworkRelayPostOpts struct { + RequestBody optional.Interface +} + +/* +ApiV1NetworkRelayPost AddRelayServers + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *NodeApiApiV1NetworkRelayPostOpts - Optional Parameters: + * @param "RequestBody" (optional.Interface of []string) - +@return ApiAddRelayServersResp +*/ +func (a *NodeApiService) ApiV1NetworkRelayPost(ctx _context.Context, localVarOptionals *NodeApiApiV1NetworkRelayPostOpts) (ApiAddRelayServersResp, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ApiAddRelayServersResp + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/network/relay" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.RequestBody.IsSet() { + localVarOptionalRequestBody, localVarOptionalRequestBodyok := localVarOptionals.RequestBody.Value().([]string) + if !localVarOptionalRequestBodyok { + return localVarReturnValue, nil, reportError("requestBody should be []string") + } + localVarPostBody = &localVarOptionalRequestBody + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1NodeGet GetNodeInfo +Return the node info + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return HandlersNodeInfo +*/ +func (a *NodeApiService) ApiV1NodeGet(ctx _context.Context) (HandlersNodeInfo, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HandlersNodeInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/node" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_tools.go b/api_tools.go new file mode 100644 index 0000000..a7f59e3 --- /dev/null +++ b/api_tools.go @@ -0,0 +1,117 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ _context.Context +) + +// ToolsApiService ToolsApi service +type ToolsApiService service + +// ToolsApiApiV1ToolsPubkeytoaddrPostOpts Optional parameters for the method 'ApiV1ToolsPubkeytoaddrPost' +type ToolsApiApiV1ToolsPubkeytoaddrPostOpts struct { + ApiPubkeyParam optional.Interface +} + +/* +ApiV1ToolsPubkeytoaddrPost PubkeyToEthaddr +Convert a based64 encoded libp2p pubkey to the eth address + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *ToolsApiApiV1ToolsPubkeytoaddrPostOpts - Optional Parameters: + * @param "ApiPubkeyParam" (optional.Interface of ApiPubkeyParam) - +@return ApiPubkeyToEthaddrResult +*/ +func (a *ToolsApiService) ApiV1ToolsPubkeytoaddrPost(ctx _context.Context, localVarOptionals *ToolsApiApiV1ToolsPubkeytoaddrPostOpts) (ApiPubkeyToEthaddrResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ApiPubkeyToEthaddrResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/tools/pubkeytoaddr" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.ApiPubkeyParam.IsSet() { + localVarOptionalApiPubkeyParam, localVarOptionalApiPubkeyParamok := localVarOptionals.ApiPubkeyParam.Value().(ApiPubkeyParam) + if !localVarOptionalApiPubkeyParamok { + return localVarReturnValue, nil, reportError("apiPubkeyParam should be ApiPubkeyParam") + } + localVarPostBody = &localVarOptionalApiPubkeyParam + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_user.go b/api_user.go new file mode 100644 index 0000000..f79d5d8 --- /dev/null +++ b/api_user.go @@ -0,0 +1,355 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ _context.Context +) + +// UserApiService UserApi service +type UserApiService service + +// UserApiApiV1GroupAnnouncePostOpts Optional parameters for the method 'ApiV1GroupAnnouncePost' +type UserApiApiV1GroupAnnouncePostOpts struct { + HandlersAnnounceParam optional.Interface +} + +/* +ApiV1GroupAnnouncePost AnnounceUserPubkey +Announce User's encryption Pubkey to the group + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *UserApiApiV1GroupAnnouncePostOpts - Optional Parameters: + * @param "HandlersAnnounceParam" (optional.Interface of HandlersAnnounceParam) - +@return HandlersAnnounceResult +*/ +func (a *UserApiService) ApiV1GroupAnnouncePost(ctx _context.Context, localVarOptionals *UserApiApiV1GroupAnnouncePostOpts) (HandlersAnnounceResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HandlersAnnounceResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/announce" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.HandlersAnnounceParam.IsSet() { + localVarOptionalHandlersAnnounceParam, localVarOptionalHandlersAnnounceParamok := localVarOptionals.HandlersAnnounceParam.Value().(HandlersAnnounceParam) + if !localVarOptionalHandlersAnnounceParamok { + return localVarReturnValue, nil, reportError("handlersAnnounceParam should be HandlersAnnounceParam") + } + localVarPostBody = &localVarOptionalHandlersAnnounceParam + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1GroupGroupIdAnnouncedProducersGet GetAnnouncedGroupProducer +Get the list of group producers + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id +@return []HandlersAnnouncedProducerListItem +*/ +func (a *UserApiService) ApiV1GroupGroupIdAnnouncedProducersGet(ctx _context.Context, groupId string) ([]HandlersAnnouncedProducerListItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []HandlersAnnouncedProducerListItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/{group_id}/announced/producers" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1GroupGroupIdAnnouncedUserSignPubkeyGet GetAnnouncedGroupUser +Get the one user announce status + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id + * @param signPubkey User SignPubkey +@return HandlersAnnouncedUserListItem +*/ +func (a *UserApiService) ApiV1GroupGroupIdAnnouncedUserSignPubkeyGet(ctx _context.Context, groupId string, signPubkey string) (HandlersAnnouncedUserListItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HandlersAnnouncedUserListItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/{group_id}/announced/user/{sign_pubkey}" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarPath = strings.Replace(localVarPath, "{"+"sign_pubkey"+"}", _neturl.QueryEscape(parameterToString(signPubkey, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +ApiV1GroupGroupIdAnnouncedUsersGet GetAnnouncedGroupUsers +Get the list of private group users + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId Group Id +@return []HandlersAnnouncedUserListItem +*/ +func (a *UserApiService) ApiV1GroupGroupIdAnnouncedUsersGet(ctx _context.Context, groupId string) ([]HandlersAnnouncedUserListItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []HandlersAnnouncedUserListItem + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/api/v1/group/{group_id}/announced/users" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.QueryEscape(parameterToString(groupId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/apps.go b/apps.go deleted file mode 100644 index 26c01a0..0000000 --- a/apps.go +++ /dev/null @@ -1,57 +0,0 @@ -package rumgosdk - -import ( - "encoding/json" - "fmt" - - "github.com/tymon42/rum-go-sdk/model" -) - -// GetGroupContents gets contents in a group, /app/api/v1/group/{group_id}/contents -// Param: 1. group_id, 2. num, 3. reverse, 4. starttrx, 5. includestarttrx, 6. nonce, 7. appapiSenderList -// Return: appapiGroupContentObjectItem -func (q *Quorum) GetGroupContents(groupID string, num int, reverse string, starttrx string, includestarttrx string, nonce int, appapiSenderList model.AppapiSenderList) ([]model.AppapiGroupContentObjectItem, error) { - url := q.ApiServer + "/app/api/v1/group/" + groupID + "/content" - res := []model.AppapiGroupContentObjectItem{} - resp, err := q.HttpClient.R().SetQueryParams(map[string]string{ - "num": fmt.Sprint(num), - "reverse": reverse, - "starttrx": starttrx, - "includestarttrx": includestarttrx, - "nonce": fmt.Sprint(nonce), - }).SetBody(appapiSenderList).SetResult(res).Post(url) - if err != nil { - return nil, err - } - - detailsEntity := []model.AppapiGroupContentObjectItem{} - err = json.Unmarshal(resp.Body(), &detailsEntity) - - return detailsEntity, err -} - -// CreateToken creates a new auth token, only allow access from localhost, /app/api/v1/token/create -// Param: appapi.CreateJWTParams -// Return: appapiTokenItem -func (q *Quorum) CreateToken(param *model.AppapiCreateJwtParams) (*model.AppapiTokenItem, error) { - url := q.ApiServer + "/app/api/v1/token/create" - res := &model.AppapiTokenItem{} - _, err := q.HttpClient.R().SetBody(param).SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, err -} - -// RefreshToken gets a new auth token, /app/api/v1/token/refresh -// Headers: Authorization: {token} -// Return: appapiTokenItem -func (q *Quorum) RefreshToken(token string) (*model.AppapiTokenItem, error) { - url := q.ApiServer + "/app/api/v1/token/refresh" - res := &model.AppapiTokenItem{} - _, err := q.HttpClient.R().SetHeader("Authorization", token).SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, err -} diff --git a/chain.go b/chain.go deleted file mode 100644 index 95ed2a4..0000000 --- a/chain.go +++ /dev/null @@ -1,42 +0,0 @@ -package rumgosdk - -import ( - "github.com/tymon42/rum-go-sdk/model" -) - -// GetBlock gets block, /api/v1/block/{group_id}/{block_id} -// return pbBlock -func (q *Quorum) GetBlock(group_id string, block_id string) (*model.PbBlock, error) { - url := q.ApiServer + "/api/v1/block/" + group_id + "/" + block_id - res := &model.PbBlock{} - _, err := q.HttpClient.R().SetResult(res).Get(url) - if err != nil { - return nil, err - } - return res, nil -} - -// PubQueueAck acknowledges pub queue, /api/v1/trx/ack -// param: apiPubQueueAckPayload -// return: []string -func (q *Quorum) PubQueueAck(param model.ApiPubQueueAckPayload) ([]string, error) { - url := q.ApiServer + "/api/v1/trx/ack" - res := []string{} - _, err := q.HttpClient.R().SetBody(param).SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, nil -} - -// GetTrx gets trx of group, /api/v1/trx/{group_id}/{trx_id} -// return pbTrx -func (q *Quorum) GetTrx(group_id string, trx_id string) (*model.PbTrx, error) { - url := q.ApiServer + "/api/v1/trx/" + group_id + "/" + trx_id - res := &model.PbTrx{} - _, err := q.HttpClient.R().SetResult(res).Get(url) - if err != nil { - return nil, err - } - return res, nil -} diff --git a/client.go b/client.go new file mode 100644 index 0000000..5f5153d --- /dev/null +++ b/client.go @@ -0,0 +1,569 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "io/ioutil" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "golang.org/x/oauth2" +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) +) + +// APIClient manages communication with the rum API v1.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + AppsApi *AppsApiService + + ChainApi *ChainApiService + + GroupApi *GroupApiService + + GroupsApi *GroupsApiService + + KeystoreApi *KeystoreApiService + + LightNodeApi *LightNodeApiService + + ManagementApi *ManagementApiService + + NodeApi *NodeApiService + + ToolsApi *ToolsApiService + + UserApi *UserApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.AppsApi = (*AppsApiService)(&c.common) + c.ChainApi = (*ChainApiService)(&c.common) + c.GroupApi = (*GroupApiService)(&c.common) + c.GroupsApi = (*GroupsApiService)(&c.common) + c.KeystoreApi = (*KeystoreApiService)(&c.common) + c.LightNodeApi = (*LightNodeApiService)(&c.common) + c.ManagementApi = (*ManagementApiService)(&c.common) + c.NodeApi = (*NodeApiService)(&c.common) + c.ToolsApi = (*ToolsApiService)(&c.common) + c.UserApi = (*UserApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insenstive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. +func parameterToString(obj interface{}, collectionFormat string) string { + var delimiter string + + switch collectionFormat { + case "pipes": + delimiter = "|" + case "ssv": + delimiter = " " + case "tsv": + delimiter = "\t" + case "csv": + delimiter = "," + } + + if reflect.TypeOf(obj).Kind() == reflect.Slice { + return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } else if t, ok := obj.(time.Time); ok { + return t.Format(time.RFC3339) + } + + return fmt.Sprintf("%v", obj) +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + + return resp, err +} + +// ChangeBasePath changes base path to allow switching to mocks +func (c *APIClient) ChangeBasePath(path string) { + c.cfg.BasePath = path +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *Configuration { + return c.cfg +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFileName string, + fileName string, + fileBytes []byte) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + if len(fileBytes) > 0 && fileName != "" { + w.Boundary() + //_, fileNm := filepath.Split(fileName) + part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(fileBytes) + if err != nil { + return nil, err + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = query.Encode() + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers.Set(h, v) + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(**os.File); ok { + *f, err = ioutil.TempFile("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if err = json.Unmarshal(b, v); err != nil { + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("Invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} diff --git a/configuration.go b/configuration.go new file mode 100644 index 0000000..5c2d152 --- /dev/null +++ b/configuration.go @@ -0,0 +1,130 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk + +import ( + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. + ContextOAuth2 = contextKey("token") + + // ContextBasicAuth takes BasicAuth as authentication for the request. + ContextBasicAuth = contextKey("basic") + + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextAPIKey takes an APIKey as authentication for the request + ContextAPIKey = contextKey("apikey") + +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + Url string + Description string + Variables map[string]ServerVariable +} + +// Configuration stores the configuration of the API client +type Configuration struct { + BasePath string `json:"basePath,omitempty"` + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers []ServerConfiguration + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + BasePath: "http://localhost", + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: []ServerConfiguration{ + { + Url: "/", + Description: "No description provided", + }, + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// ServerUrl returns URL based on server settings +func (c *Configuration) ServerUrl(index int, variables map[string]string) (string, error) { + if index < 0 || len(c.Servers) <= index { + return "", fmt.Errorf("Index %v out of range %v", index, len(c.Servers) - 1) + } + server := c.Servers[index] + url := server.Url + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} diff --git a/go.mod b/go.mod index 01e5389..f55c146 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ -module github.com/tymon42/rum-go-sdk +module github.com/GIT_USER_ID/GIT_REPO_ID -go 1.17 - -require github.com/go-resty/resty/v2 v2.7.0 - -require golang.org/x/net v0.1.0 // indirect +require ( + github.com/antihax/optional v1.0.0 + golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 + +) diff --git a/go.sum b/go.sum index 40b5849..ee69520 100644 --- a/go.sum +++ b/go.sum @@ -1,33 +1,17 @@ -github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= -github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/aws/aws-sdk-go v1.26.3 h1:szQdfJcUBAhQT0zZEx4sxoDuWb7iScoucxCiVxDmaBk= +github.com/aws/aws-sdk-go v1.26.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/group.go b/group.go deleted file mode 100644 index c24ea3e..0000000 --- a/group.go +++ /dev/null @@ -1,18 +0,0 @@ -package rumgosdk - -import ( - "github.com/tymon42/rum-go-sdk/model" -) - -// StartSync starts sync, /api/v1/group/{group_id}/startsync -// Param: 1. group_id -// Return: apiStartSyncResult -func (q *Quorum) StartSync(groupID string) (*model.ApiStartSyncResult, error) { - url := q.ApiServer + "/api/v1/group/" + groupID + "/startsync" - res := &model.ApiStartSyncResult{} - _, err := q.HttpClient.R().SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, err -} diff --git a/groups.go b/groups.go deleted file mode 100644 index f7e7599..0000000 --- a/groups.go +++ /dev/null @@ -1,155 +0,0 @@ -package rumgosdk - -import ( - "encoding/json" - "fmt" - - "github.com/tymon42/rum-go-sdk/model" -) - -// CreateGroupUrl create group url, /api/v1/group -// param: model.handlerCreateGroupParam -func (q *Quorum) CreateGroupUrl(param model.HandlersCreateGroupParam) (*model.HandlersCreateGroupResult, error) { - url := q.ApiServer + "/api/v1/group" - res := &model.HandlersCreateGroupResult{} - _, err := q.HttpClient.R().SetBody(param).SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, nil -} - -// ClearGroupData clears group data, /api/v1/clear -func (q *Quorum) ClearGroupData() error { - url := q.ApiServer + "/api/v1/clear" - _, err := q.HttpClient.R().Post(url) - return err -} - -// PostToGroup posts object to group, /api/v1/group/content -// param: pbActivity -// return: HandlersTrxResult -func (q *Quorum) PostToGroup(param *model.PbActivity) (*model.HandlersTrxResult, error) { - url := q.ApiServer + "/api/v1/group/content" - res := &model.HandlersTrxResult{} - b, _ := json.Marshal(param) - fmt.Println("PostToGroup", string(b)) - // jsonstring:=`{ - // "type": "Add", - // "object": { - // "type": "Note", - // "content": "Good Morning!\nHave a nice day." - // }, - // "target": { - // "id": "87ce7f91-2bcc-46e5-9d42-b64fe24d5220", - // "type": "Group" - // } - // }` - resp, err := q.HttpClient.R().SetBody(b).SetResult(res).Post(url) - if err != nil { - return nil, err - } - fmt.Println(resp) - fmt.Println("PostToGroup", res) - return res, nil -} - -// PostToGroupWithPlainText posts object to group with plain text, /api/v1/group/content -// param: GroupId, Content, Title -// return: HandlersTrxResult -func (q *Quorum) PostToGroupWithPlainText(groupId, title, content string) (*model.HandlersTrxResult, error) { - url := q.ApiServer + "/api/v1/group/content" - res := &model.HandlersTrxResult{} - jsonstring := `{ - "type": "Add", - "object": { - "type": "Note", - "name": "` + title + `", - "content": "` + content + `" - }, - "target": { - "id": "`+groupId+`", - "type": "Group" - } - }` - _, err := q.HttpClient.R().SetBody(jsonstring).SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, nil -} - -// JoinGroup joins group, /api/v1/group/join -// param: handlersGroupSeed -// return: apiJoinGroupResult -func (q *Quorum) JoinGroup(param model.HandlersGroupSeed) (*model.ApiJoinGroupResult, error) { - url := q.ApiServer + "/api/v1/group/join" - res := &model.ApiJoinGroupResult{} - _, err := q.HttpClient.R().SetBody(param).SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, nil -} - -// JoinGroupByNewSeed joins group by new seed, /api/v1/group/join -// param: seed -// return: apiJoinGroupResult -func (q *Quorum) JoinGroupV2(param *model.HandlersJoinGroupParamV2) (*model.ApiJoinGroupResult, error) { - url := q.ApiServer + "/api/v2/group/join" - res := &model.ApiJoinGroupResult{} - _, err := q.HttpClient.R().SetBody(param).SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, nil -} - -// LeaveGroup leaves group, /api/v1/group/leave -// param: handlersGroupSeed -// return: HandlersLeaveGroupResult -func (q *Quorum) LeaveGroup(param model.HandlersGroupSeed) (*model.HandlersLeaveGroupResult, error) { - url := q.ApiServer + "/api/v1/group/leave" - res := &model.HandlersLeaveGroupResult{} - _, err := q.HttpClient.R().SetBody(param).SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, nil -} - -// GetPubQueue gets pub queue, /api/v1/group/{group_id}/pubqueue -// return handlersPubQueueInfo -func (q *Quorum) GetPubQueue(group_id string) (*model.HandlersPubQueueInfo, error) { - url := q.ApiServer + "/api/v1/group/" + group_id + "/pubqueue" - res := &model.HandlersPubQueueInfo{} - _, err := q.HttpClient.R().SetResult(res).Get(url) - if err != nil { - return nil, err - } - return res, nil -} - -// GetGroupSeed gets group seed, /api/v1/group/{group_id}/seed -// return handlersGroupSeedResult -func (q *Quorum) GetGroupSeed(group_id string) (*model.HandlersGetGroupSeedResult, error) { - url := q.ApiServer + "/api/v1/group/" + group_id + "/seed" - res := &model.HandlersGetGroupSeedResult{} - _, err := q.HttpClient.R().SetResult(res).Get(url) - if err != nil { - return nil, err - } - return res, nil -} - -// GetGroups gets groups, /api/v1/groups -// return apiGroupsList -func (q *Quorum) GetGroups() (*model.ApiGroupInfoList, error) { - url := q.ApiServer + "/api/v1/groups" - res := &model.ApiGroupInfoList{} - _, err := q.HttpClient.R().SetResult(res).Get(url) - if err != nil { - return nil, err - } - return res, nil -} diff --git a/keystore.go b/keystore.go deleted file mode 100644 index 5d1fe3e..0000000 --- a/keystore.go +++ /dev/null @@ -1,18 +0,0 @@ -package rumgosdk - -import ( - "github.com/tymon42/rum-go-sdk/model" -) - -// SignTx signs a transaction, /api/v1/keystore/signtx -// Param: apiSignTxParam -// Return: apiSignTxResult -func (q *Quorum) SignTx(param *model.ApiSignTxParam) (*model.ApiSignTxResult, error) { - url := q.ApiServer + "/api/v1/keystore/signtx" - res := &model.ApiSignTxResult{} - _, err := q.HttpClient.R().SetBody(param).SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, err -} diff --git a/management.go b/management.go deleted file mode 100644 index 6207587..0000000 --- a/management.go +++ /dev/null @@ -1,135 +0,0 @@ -package rumgosdk - -import ( - "github.com/tymon42/rum-go-sdk/model" -) - -// MgrAppConfig set app config -// Param: handlersAppConfigParam -// Return: handlersAppConfigResult -func (q *Quorum) MgrAppConfig(param *model.HandlersAppConfigParam) (*model.HandlersAppConfigResult, error) { - url := q.ApiServer + "/api/v1/group/appconfig" - res := &model.HandlersAppConfigResult{} - _, err := q.HttpClient.R().SetBody(param).SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, err -} - -// ChainConfig set chain config -// Param: handlersChainConfigParams -// Return: handlersChainConfigResult -func (q *Quorum) ChainConfig(param *model.HandlersChainConfigParams) (*model.HandlersChainConfigResult, error) { - url := q.ApiServer + "/api/v1/group/chainconfig" - res := &model.HandlersChainConfigResult{} - _, err := q.HttpClient.R().SetBody(param).SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, err -} - -// AddProducer add a peer to the group producer list -// Param: handlersGrpProducerParam -// Return: handlersGrpProducerResult -func (q *Quorum) AddProducer(param *model.HandlersGrpProducerParam) (*model.HandlersGrpProducerResult, error) { - url := q.ApiServer + "/api/v1/group/producer" - res := &model.HandlersGrpProducerResult{} - _, err := q.HttpClient.R().SetBody(param).SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, err -} - -// AddUsers add a user to a private group users list -// Param: apiGrpUserParam -// Return: apiGrpUserResult -func (q *Quorum) AddUsers(param *model.ApiGrpUserParam) (*model.ApiGrpUserResult, error) { - url := q.ApiServer + "/api/v1/group/user" - res := &model.ApiGrpUserResult{} - _, err := q.HttpClient.R().SetBody(param).SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, err -} - -// GetAppConfigKey get app config key list, /api/v1/group/{group_id}/config/keylist -// Param: 1. group_id -// Return: handlersAppConfigListItemResult -func (q *Quorum) GetAppConfigKey(groupID string) ([]*model.HandlersAppConfigKeyListItem, error) { - url := q.ApiServer + "/api/v1/group/" + groupID + "/config/keylist" - var res []*model.HandlersAppConfigKeyListItem - _, err := q.HttpClient.R().SetResult(res).Get(url) - if err != nil { - return nil, err - } - return res, err -} - -// GetAppConfigItem get app config item, /api/v1/group/{group_id}/config/{key} -// Param: 1. group_id 2. key -// Return: handlersAppConfigKeyIterm -func (q *Quorum) GetAppConfigItem(groupID, key string) (*model.HandlersAppConfigKeyItem, error) { - url := q.ApiServer + "/api/v1/group/" + groupID + "/config/" + key - res := &model.HandlersAppConfigKeyItem{} - _, err := q.HttpClient.R().SetResult(res).Get(url) - if err != nil { - return nil, err - } - return res, err -} - -// GetGroupProducers get the list of group producers, /api/v1/group/{group_id}/producers -// Param: 1. group_id -// Return: []handlersProducerListItem -func (q *Quorum) GetGroupProducers(groupID string) ([]*model.HandlersProducerListItem, error) { - url := q.ApiServer + "/api/v1/group/" + groupID + "/producers" - var res []*model.HandlersProducerListItem - _, err := q.HttpClient.R().SetResult(res).Get(url) - if err != nil { - return nil, err - } - return res, err -} - -// GetChainTrxAllowList gets group allow list, /api/v1/group/{group_id}/trx/allowlist -// Param: 1. group_id -// Return: []handlersChainSendTrxRuleListItem -func (q *Quorum) GetChainTrxAllowList(groupID string) ([]*model.HandlersChainSendTrxRuleListItem, error) { - url := q.ApiServer + "/api/v1/group/" + groupID + "/trx/allowlist" - var res []*model.HandlersChainSendTrxRuleListItem - _, err := q.HttpClient.R().SetResult(res).Get(url) - if err != nil { - return nil, err - } - return res, err -} - -// GetChainTrxAuthMode gets group auth mode, /api/v1/group/{group_id}/trx/auth/{trx_type} -// Param: 1. group_id 2. trx_type -// Return: []handlersTrxAuthItem -func (q *Quorum) GetChainTrxAuthMode(groupID, trxType string) ([]*model.HandlersTrxAuthItem, error) { - url := q.ApiServer + "/api/v1/group/" + groupID + "/trx/auth/" + trxType - var res []*model.HandlersTrxAuthItem - _, err := q.HttpClient.R().SetResult(res).Get(url) - if err != nil { - return nil, err - } - return res, err -} - -// GetDeniedUserList gets the list of denied users, /api/v1/group/{group_id}/trx/denylist -// Param: 1. group_id -// Return: []handlersChainSendTrxRuleListItem -func (q *Quorum) GetDeniedUserList(groupID string) ([]*model.HandlersChainSendTrxRuleListItem, error) { - url := q.ApiServer + "/api/v1/group/" + groupID + "/trx/denylist" - var res []*model.HandlersChainSendTrxRuleListItem - _, err := q.HttpClient.R().SetResult(res).Get(url) - if err != nil { - return nil, err - } - return res, err -} diff --git a/model/model_api_addr_proto_pair.go b/model/model_api_addr_proto_pair.go deleted file mode 100644 index c0dfcfd..0000000 --- a/model/model_api_addr_proto_pair.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// ApiAddrProtoPair struct for ApiAddrProtoPair -type ApiAddrProtoPair struct { - Local string `json:"local,omitempty"` - Protocol string `json:"protocol,omitempty"` - Remote string `json:"remote,omitempty"` -} diff --git a/model/model_api_group_info.go b/model/model_api_group_info.go deleted file mode 100644 index edb7a9e..0000000 --- a/model/model_api_group_info.go +++ /dev/null @@ -1,28 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// ApiGroupInfo struct for ApiGroupInfo -type ApiGroupInfo struct { - AppKey string `json:"app_key"` - CipherKey string `json:"cipher_key"` - ConsensusType string `json:"consensus_type"` - EncryptionType string `json:"encryption_type"` - GroupId string `json:"group_id"` - GroupName string `json:"group_name"` - GroupStatus string `json:"group_status"` - HighestBlockId string `json:"highest_block_id"` - HighestHeight int64 `json:"highest_height"` - LastUpdated int64 `json:"last_updated"` - OwnerPubkey string `json:"owner_pubkey"` - SnapshotInfo ApiSnapshotInfo `json:"snapshot_info,omitempty"` - UserEthAddr string `json:"user_eth_addr"` - UserPubkey string `json:"user_pubkey"` -} diff --git a/model/model_api_grp_user_result.go b/model/model_api_grp_user_result.go deleted file mode 100644 index ad9345a..0000000 --- a/model/model_api_grp_user_result.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// ApiGrpUserResult struct for ApiGrpUserResult -type ApiGrpUserResult struct { - Action string `json:"action,omitempty"` - EncryptPubkey string `json:"encrypt_pubkey,omitempty"` - GroupId string `json:"group_id,omitempty"` - Memo string `json:"memo,omitempty"` - OwnerPubkey string `json:"owner_pubkey,omitempty"` - Sign string `json:"sign,omitempty"` - TrxId string `json:"trx_id,omitempty"` - UserPubkey string `json:"user_pubkey,omitempty"` -} diff --git a/model/model_api_join_group_result.go b/model/model_api_join_group_result.go deleted file mode 100644 index 8e45f4e..0000000 --- a/model/model_api_join_group_result.go +++ /dev/null @@ -1,24 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// ApiJoinGroupResult struct for ApiJoinGroupResult -type ApiJoinGroupResult struct { - AppKey string `json:"app_key"` - CipherKey string `json:"cipher_key"` - ConsensusType string `json:"consensus_type"` - EncryptionType string `json:"encryption_type"` - GroupId string `json:"group_id"` - GroupName string `json:"group_name"` - OwnerPubkey string `json:"owner_pubkey"` - Signature string `json:"signature"` - UserEncryptpubkey string `json:"user_encryptpubkey"` - UserPubkey string `json:"user_pubkey"` -} diff --git a/model/model_api_snapshot_info.go b/model/model_api_snapshot_info.go deleted file mode 100644 index 080bd1b..0000000 --- a/model/model_api_snapshot_info.go +++ /dev/null @@ -1,20 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// ApiSnapshotInfo struct for ApiSnapshotInfo -type ApiSnapshotInfo struct { - HighestBlockId string `json:"highestBlockId,omitempty"` - HighestHeight int64 `json:"highestHeight,omitempty"` - Nonce int64 `json:"nonce,omitempty"` - SenderPubkey string `json:"senderPubkey,omitempty"` - SnapshotPackageId string `json:"snapshotPackageId,omitempty"` - TimeStamp int64 `json:"timeStamp,omitempty"` -} diff --git a/model/model_appapi_group_content_object_item.go b/model/model_appapi_group_content_object_item.go deleted file mode 100644 index 4108fa8..0000000 --- a/model/model_appapi_group_content_object_item.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// AppapiGroupContentObjectItem struct for AppapiGroupContentObjectItem -type AppapiGroupContentObjectItem struct { - Content interface{} `json:"content,omitempty"` - Publisher string `json:"publisher,omitempty"` - TimeStamp int64 `json:"timeStamp,omitempty"` - TrxId string `json:"trxId,omitempty"` - TypeUrl string `json:"typeUrl,omitempty"` -} diff --git a/model/model_chain_publish_queue_item.go b/model/model_chain_publish_queue_item.go deleted file mode 100644 index 5405e16..0000000 --- a/model/model_chain_publish_queue_item.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// ChainPublishQueueItem struct for ChainPublishQueueItem -type ChainPublishQueueItem struct { - UpdateAt string `json:"UpdateAt,omitempty"` - // also stored in the key for quick indexing - GroupId string `json:"groupId,omitempty"` - RetryCount int64 `json:"retryCount,omitempty"` - // in value only - State string `json:"state,omitempty"` - StorageType string `json:"storageType,omitempty"` - Trx PbTrx `json:"trx,omitempty"` -} diff --git a/model/model_handlers_group_seed.go b/model/model_handlers_group_seed.go deleted file mode 100644 index d446f32..0000000 --- a/model/model_handlers_group_seed.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// HandlersGroupSeed struct for HandlersGroupSeed -type HandlersGroupSeed struct { - AppKey string `json:"app_key"` - CipherKey string `json:"cipher_key"` - ConsensusType string `json:"consensus_type"` - EncryptionType string `json:"encryption_type"` - GenesisBlock PbBlock `json:"genesis_block"` - GroupId string `json:"group_id"` - GroupName string `json:"group_name"` - OwnerPubkey string `json:"owner_pubkey"` - Signature string `json:"signature"` -} diff --git a/model/model_handlers_network_info.go b/model/model_handlers_network_info.go deleted file mode 100644 index beb794f..0000000 --- a/model/model_handlers_network_info.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// HandlersNetworkInfo struct for HandlersNetworkInfo -type HandlersNetworkInfo struct { - Addrs []string `json:"addrs"` - EthAddr string `json:"eth_addr"` - Groups []HandlersGroupNetworkInfo `json:"groups"` - NatEnabled bool `json:"nat_enabled"` - NatType string `json:"nat_type"` - Node map[string]map[string]interface{} `json:"node"` - PeerId string `json:"peer_id"` -} diff --git a/model/model_handlers_node_info.go b/model/model_handlers_node_info.go deleted file mode 100644 index 05e8586..0000000 --- a/model/model_handlers_node_info.go +++ /dev/null @@ -1,20 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// HandlersNodeInfo struct for HandlersNodeInfo -type HandlersNodeInfo struct { - NodeId string `json:"node_id"` - NodePublickey string `json:"node_publickey"` - NodeStatus string `json:"node_status"` - NodeType string `json:"node_type"` - NodeVersion string `json:"node_version"` - Peers map[string][]string `json:"peers"` -} diff --git a/model/model_handlers_pub_queue_info.go b/model/model_handlers_pub_queue_info.go deleted file mode 100644 index 49a9ad1..0000000 --- a/model/model_handlers_pub_queue_info.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// HandlersPubQueueInfo struct for HandlersPubQueueInfo -type HandlersPubQueueInfo struct { - Data []ChainPublishQueueItem `json:"data,omitempty"` - GroupId string `json:"groupId,omitempty"` -} diff --git a/model/model_pb_activity.go b/model/model_pb_activity.go deleted file mode 100644 index ae0c76a..0000000 --- a/model/model_pb_activity.go +++ /dev/null @@ -1,49 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// PbActivity struct for PbActivity -type PbActivity struct { - Actor PbObject `json:"actor,omitempty"` - Attachments []PbObject `json:"attachments,omitempty"` - AttributedTo []PbObject `json:"attributedTo,omitempty"` - Audience PbObject `json:"audience,omitempty"` - Bcc []PbObject `json:"bcc,omitempty"` - Bto []PbObject `json:"bto,omitempty"` - Cc []PbObject `json:"cc,omitempty"` - Content string `json:"content,omitempty"` - Context PbObject `json:"context,omitempty"` - Duration string `json:"duration,omitempty"` - Endtime TimestamppbTimestamp `json:"endtime,omitempty"` - Generator PbObject `json:"generator,omitempty"` - Icon []PbObject `json:"icon,omitempty"` - Id string `json:"id,omitempty"` - Image []PbObject `json:"image,omitempty"` - InReplyTo PbObject `json:"inReplyTo,omitempty"` - Instrument PbObject `json:"instrument,omitempty"` - Location PbObject `json:"location,omitempty"` - MediaType string `json:"mediaType,omitempty"` - Name string `json:"name,omitempty"` - Object PbObject `json:"object,omitempty"` - Origin PbObject `json:"origin,omitempty"` - Person PbPerson `json:"person,omitempty"` - Preview PbObject `json:"preview,omitempty"` - Published TimestamppbTimestamp `json:"published,omitempty"` - Replies PbObject `json:"replies,omitempty"` - Result PbObject `json:"result,omitempty"` - StartTime TimestamppbTimestamp `json:"startTime,omitempty"` - Summary string `json:"summary,omitempty"` - Tag []PbObject `json:"tag,omitempty"` - Target PbObject `json:"target,omitempty"` - To []PbObject `json:"to,omitempty"` - Type string `json:"type,omitempty"` - Updated TimestamppbTimestamp `json:"updated,omitempty"` - Url []PbLink `json:"url,omitempty"` -} diff --git a/model/model_pb_block.go b/model/model_pb_block.go deleted file mode 100644 index af5003a..0000000 --- a/model/model_pb_block.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// PbBlock struct for PbBlock -type PbBlock struct { - BlockId string `json:"BlockId,omitempty"` - GroupId string `json:"GroupId,omitempty"` - Hash []int64 `json:"Hash,omitempty"` - PrevBlockId string `json:"PrevBlockId,omitempty"` - PreviousHash []int64 `json:"PreviousHash,omitempty"` - ProducerPubKey string `json:"ProducerPubKey,omitempty"` - Signature []int64 `json:"Signature,omitempty"` - TimeStamp string `json:"TimeStamp,omitempty"` - Trxs []PbTrx `json:"Trxs,omitempty"` -} diff --git a/model/model_pb_file.go b/model/model_pb_file.go deleted file mode 100644 index d034bec..0000000 --- a/model/model_pb_file.go +++ /dev/null @@ -1,20 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// PbFile struct for PbFile -type PbFile struct { - Compression int64 `json:"compression,omitempty"` - Content []int64 `json:"content,omitempty"` - Id string `json:"id,omitempty"` - MediaType string `json:"mediaType,omitempty"` - Name string `json:"name,omitempty"` - Url string `json:"url,omitempty"` -} diff --git a/model/model_pb_image.go b/model/model_pb_image.go deleted file mode 100644 index 676dd86..0000000 --- a/model/model_pb_image.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// PbImage struct for PbImage -type PbImage struct { - Content []int64 `json:"content,omitempty"` - Id string `json:"id,omitempty"` - MediaType string `json:"mediaType,omitempty"` - Name string `json:"name,omitempty"` - Url string `json:"url,omitempty"` -} diff --git a/model/model_pb_link.go b/model/model_pb_link.go deleted file mode 100644 index 99986ed..0000000 --- a/model/model_pb_link.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// PbLink struct for PbLink -type PbLink struct { - Height int64 `json:"height,omitempty"` - Href string `json:"href,omitempty"` - Hreflang string `json:"hreflang,omitempty"` - MediaType string `json:"mediaType,omitempty"` - Name string `json:"name,omitempty"` - Preview PbObject `json:"preview,omitempty"` - Rel []string `json:"rel,omitempty"` - Width int64 `json:"width,omitempty"` -} diff --git a/model/model_pb_object.go b/model/model_pb_object.go deleted file mode 100644 index 9b723ab..0000000 --- a/model/model_pb_object.go +++ /dev/null @@ -1,43 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// PbObject struct for PbObject -type PbObject struct { - Attachments []interface{} `json:"attachments,omitempty"` - AttributedTo []interface{} `json:"attributedTo,omitempty"` - Audience interface{} `json:"audience,omitempty"` - Bcc []interface{} `json:"bcc,omitempty"` - Bto []interface{} `json:"bto,omitempty"` - Cc []interface{} `json:"cc,omitempty"` - Content string `json:"content,omitempty"` - Context interface{} `json:"context,omitempty"` - Duration string `json:"duration,omitempty"` - Endtime TimestamppbTimestamp `json:"endtime,omitempty"` - File PbFile `json:"file,omitempty"` - Generator interface{} `json:"generator,omitempty"` - Icon []interface{} `json:"icon,omitempty"` - Id string `json:"id,omitempty"` - Image []PbImage `json:"image,omitempty"` - Inreplyto PbReply `json:"inreplyto,omitempty"` - Location interface{} `json:"location,omitempty"` - MediaType string `json:"mediaType,omitempty"` - Name string `json:"name,omitempty"` - Preview interface{} `json:"preview,omitempty"` - Published TimestamppbTimestamp `json:"published,omitempty"` - Replies interface{} `json:"replies,omitempty"` - StartTime TimestamppbTimestamp `json:"startTime,omitempty"` - Summary string `json:"summary,omitempty"` - Tag []interface{} `json:"tag,omitempty"` - To []interface{} `json:"to,omitempty"` - Type string `json:"type,omitempty"` - Updated TimestamppbTimestamp `json:"updated,omitempty"` - Url []PbLink `json:"url,omitempty"` -} diff --git a/model/model_pb_payment.go b/model/model_pb_payment.go deleted file mode 100644 index bc13417..0000000 --- a/model/model_pb_payment.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// PbPayment struct for PbPayment -type PbPayment struct { - Id string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` -} diff --git a/model/model_pb_person.go b/model/model_pb_person.go deleted file mode 100644 index 420e820..0000000 --- a/model/model_pb_person.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// PbPerson struct for PbPerson -type PbPerson struct { - Id string `json:"id,omitempty"` - Image PbImage `json:"image,omitempty"` - Name string `json:"name,omitempty"` - Wallet []PbPayment `json:"wallet,omitempty"` -} diff --git a/model/model_pb_reply.go b/model/model_pb_reply.go deleted file mode 100644 index 62de787..0000000 --- a/model/model_pb_reply.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// PbReply struct for PbReply -type PbReply struct { - Groupid string `json:"groupid,omitempty"` - Trxid string `json:"trxid,omitempty"` -} diff --git a/model/model_pb_trx.go b/model/model_pb_trx.go deleted file mode 100644 index 50a63fd..0000000 --- a/model/model_pb_trx.go +++ /dev/null @@ -1,26 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// PbTrx struct for PbTrx -type PbTrx struct { - Data []int64 `json:"Data,omitempty"` - Expired int64 `json:"Expired,omitempty"` - GroupId string `json:"GroupId,omitempty"` - Nonce int64 `json:"Nonce,omitempty"` - ResendCount int64 `json:"ResendCount,omitempty"` - SenderPubkey string `json:"SenderPubkey,omitempty"` - SenderSign []int64 `json:"SenderSign,omitempty"` - StorageType int64 `json:"StorageType,omitempty"` - TimeStamp string `json:"TimeStamp,omitempty"` - TrxId string `json:"TrxId,omitempty"` - Type int64 `json:"Type,omitempty"` - Version string `json:"Version,omitempty"` -} diff --git a/model/model_timestamppb_timestamp.go b/model/model_timestamppb_timestamp.go deleted file mode 100644 index d975950..0000000 --- a/model/model_timestamppb_timestamp.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * rum - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package model - -// TimestamppbTimestamp struct for TimestamppbTimestamp -type TimestamppbTimestamp struct { - // Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - Nanos int64 `json:"nanos,omitempty"` - // Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - Seconds int64 `json:"seconds,omitempty"` -} diff --git a/model/model_api_add_relay_servers_resp.go b/model_api_add_relay_servers_resp.go similarity index 95% rename from model/model_api_add_relay_servers_resp.go rename to model_api_add_relay_servers_resp.go index 280d054..aadf670 100644 --- a/model/model_api_add_relay_servers_resp.go +++ b/model_api_add_relay_servers_resp.go @@ -7,8 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // ApiAddRelayServersResp struct for ApiAddRelayServersResp type ApiAddRelayServersResp struct { Ok bool `json:"ok,omitempty"` diff --git a/model_api_get_user_encrypt_pub_keys_result.go b/model_api_get_user_encrypt_pub_keys_result.go new file mode 100644 index 0000000..6fa1346 --- /dev/null +++ b/model_api_get_user_encrypt_pub_keys_result.go @@ -0,0 +1,14 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// ApiGetUserEncryptPubKeysResult struct for ApiGetUserEncryptPubKeysResult +type ApiGetUserEncryptPubKeysResult struct { + Keys []string `json:"keys,omitempty"` +} diff --git a/model_api_group_info.go b/model_api_group_info.go new file mode 100644 index 0000000..4e04660 --- /dev/null +++ b/model_api_group_info.go @@ -0,0 +1,28 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// ApiGroupInfo struct for ApiGroupInfo +type ApiGroupInfo struct { + AppKey string `json:"app_key"` + CipherKey string `json:"cipher_key"` + ConsensusType string `json:"consensus_type"` + CurrtEpoch int32 `json:"currt_epoch"` + CurrtTopBlock int32 `json:"currt_top_block"` + EncryptionType string `json:"encryption_type"` + GroupId string `json:"group_id"` + GroupName string `json:"group_name"` + LastUpdated int32 `json:"last_updated"` + OwnerPubkey string `json:"owner_pubkey"` + Peers []string `json:"peers"` + RexSyncerResult DefRexSyncResult `json:"rex_Syncer_result"` + RexSyncerStatus string `json:"rex_syncer_status"` + UserEthAddr string `json:"user_eth_addr"` + UserPubkey string `json:"user_pubkey"` +} diff --git a/model/model_api_group_info_list.go b/model_api_group_info_list.go similarity index 95% rename from model/model_api_group_info_list.go rename to model_api_group_info_list.go index c02e22a..d357253 100644 --- a/model/model_api_group_info_list.go +++ b/model_api_group_info_list.go @@ -7,8 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // ApiGroupInfoList struct for ApiGroupInfoList type ApiGroupInfoList struct { Groups []ApiGroupInfo `json:"groups,omitempty"` diff --git a/model_api_grp_info_node_sdk.go b/model_api_grp_info_node_sdk.go new file mode 100644 index 0000000..41767d0 --- /dev/null +++ b/model_api_grp_info_node_sdk.go @@ -0,0 +1,18 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// ApiGrpInfoNodeSdk struct for ApiGrpInfoNodeSdk +type ApiGrpInfoNodeSdk struct { + GroupId string `json:"group_id,omitempty"` + LatestUpdate int32 `json:"latest_update,omitempty"` + Owner string `json:"owner,omitempty"` + Provider string `json:"provider,omitempty"` + Singature string `json:"singature,omitempty"` +} diff --git a/model/model_api_grp_user_param.go b/model_api_grp_user_param.go similarity index 72% rename from model/model_api_grp_user_param.go rename to model_api_grp_user_param.go index 9a5d0de..624c592 100644 --- a/model/model_api_grp_user_param.go +++ b/model_api_grp_user_param.go @@ -7,12 +7,11 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // ApiGrpUserParam struct for ApiGrpUserParam type ApiGrpUserParam struct { - Action string `json:"action"` - GroupId string `json:"group_id"` - Memo string `json:"memo,omitempty"` + Action string `json:"action"` + GroupId string `json:"group_id"` + Memo string `json:"memo,omitempty"` UserPubkey string `json:"user_pubkey"` } diff --git a/model_api_grp_user_result.go b/model_api_grp_user_result.go new file mode 100644 index 0000000..c5910f8 --- /dev/null +++ b/model_api_grp_user_result.go @@ -0,0 +1,21 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// ApiGrpUserResult struct for ApiGrpUserResult +type ApiGrpUserResult struct { + Action string `json:"action,omitempty"` + EncryptPubkey string `json:"encrypt_pubkey,omitempty"` + GroupId string `json:"group_id,omitempty"` + Memo string `json:"memo,omitempty"` + OwnerPubkey string `json:"owner_pubkey,omitempty"` + Sign string `json:"sign,omitempty"` + TrxId string `json:"trx_id,omitempty"` + UserPubkey string `json:"user_pubkey,omitempty"` +} diff --git a/model_api_join_group_result.go b/model_api_join_group_result.go new file mode 100644 index 0000000..11aa2cb --- /dev/null +++ b/model_api_join_group_result.go @@ -0,0 +1,23 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// ApiJoinGroupResult struct for ApiJoinGroupResult +type ApiJoinGroupResult struct { + AppKey string `json:"app_key"` + CipherKey string `json:"cipher_key"` + ConsensusType string `json:"consensus_type"` + EncryptionType string `json:"encryption_type"` + GroupId string `json:"group_id"` + GroupName string `json:"group_name"` + OwnerPubkey string `json:"owner_pubkey"` + Signature string `json:"signature"` + UserEncryptpubkey string `json:"user_encryptpubkey"` + UserPubkey string `json:"user_pubkey"` +} diff --git a/model/model_handlers_ping_resp.go b/model_api_n_sdk_announce_params.go similarity index 60% rename from model/model_handlers_ping_resp.go rename to model_api_n_sdk_announce_params.go index a33e639..d77891c 100644 --- a/model/model_handlers_ping_resp.go +++ b/model_api_n_sdk_announce_params.go @@ -7,9 +7,8 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - -// HandlersPingResp struct for HandlersPingResp -type HandlersPingResp struct { - Ttl []int64 `json:"ttl,omitempty"` +package rum_sdk +// ApiNSdkAnnounceParams struct for ApiNSdkAnnounceParams +type ApiNSdkAnnounceParams struct { + Data PbAnnounceItem `json:"data"` } diff --git a/model_api_n_sdk_send_trx_params.go b/model_api_n_sdk_send_trx_params.go new file mode 100644 index 0000000..4c37b8a --- /dev/null +++ b/model_api_n_sdk_send_trx_params.go @@ -0,0 +1,20 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// ApiNSdkSendTrxParams struct for ApiNSdkSendTrxParams +type ApiNSdkSendTrxParams struct { + Data string `json:"data"` + SenderPubkey string `json:"sender_pubkey"` + SenderSign string `json:"sender_sign"` + // nanosecond + Timestamp string `json:"timestamp,omitempty"` + TrxId string `json:"trx_id"` + Version string `json:"version"` +} diff --git a/model/model_api_pubkey_param.go b/model_api_pubkey_param.go similarity index 95% rename from model/model_api_pubkey_param.go rename to model_api_pubkey_param.go index d00a688..97c7023 100644 --- a/model/model_api_pubkey_param.go +++ b/model_api_pubkey_param.go @@ -7,8 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // ApiPubkeyParam struct for ApiPubkeyParam type ApiPubkeyParam struct { EncodedPubkey string `json:"encoded_pubkey"` diff --git a/model/model_api_pub_queue_ack_payload.go b/model_api_pubkey_to_ethaddr_result.go similarity index 58% rename from model/model_api_pub_queue_ack_payload.go rename to model_api_pubkey_to_ethaddr_result.go index 6cf6f0c..38f5f54 100644 --- a/model/model_api_pub_queue_ack_payload.go +++ b/model_api_pubkey_to_ethaddr_result.go @@ -7,9 +7,8 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - -// ApiPubQueueAckPayload struct for ApiPubQueueAckPayload -type ApiPubQueueAckPayload struct { - TrxIds []string `json:"trx_ids,omitempty"` +package rum_sdk +// ApiPubkeyToEthaddrResult struct for ApiPubkeyToEthaddrResult +type ApiPubkeyToEthaddrResult struct { + Addr string `json:"addr,omitempty"` } diff --git a/model/model_handlers_update_profile_result.go b/model_api_send_trx_result.go similarity index 66% rename from model/model_handlers_update_profile_result.go rename to model_api_send_trx_result.go index b9d5dc2..3d834c2 100644 --- a/model/model_handlers_update_profile_result.go +++ b/model_api_send_trx_result.go @@ -7,9 +7,8 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - -// HandlersUpdateProfileResult struct for HandlersUpdateProfileResult -type HandlersUpdateProfileResult struct { +package rum_sdk +// ApiSendTrxResult struct for ApiSendTrxResult +type ApiSendTrxResult struct { TrxId string `json:"trx_id"` } diff --git a/model/model_api_sign_tx_param.go b/model_api_sign_tx_param.go similarity index 77% rename from model/model_api_sign_tx_param.go rename to model_api_sign_tx_param.go index cd2af3f..5896fa1 100644 --- a/model/model_api_sign_tx_param.go +++ b/model_api_sign_tx_param.go @@ -7,21 +7,20 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // ApiSignTxParam struct for ApiSignTxParam type ApiSignTxParam struct { // ChainID string, the number prefix determines the actual base ChainId string `json:"chain_id"` // Data hex encode string, include prefix string \"0x\" - Data string `json:"data"` - GasLimit int64 `json:"gas_limit,omitempty"` + Data string `json:"data"` + GasLimit int32 `json:"gas_limit,omitempty"` // GasPrice string, the number prefix determines the actual base GasPrice string `json:"gas_price,omitempty"` Keyalias string `json:"keyalias,omitempty"` - Keyname string `json:"keyname,omitempty"` - Nonce int64 `json:"nonce,omitempty"` - // To eth address, e.g.: 0xab... + Keyname string `json:"keyname,omitempty"` + Nonce int32 `json:"nonce,omitempty"` + // eth address To string `json:"to"` // Value string, the number prefix determines the actual base Value string `json:"value,omitempty"` diff --git a/model/model_api_sign_tx_result.go b/model_api_sign_tx_result.go similarity index 95% rename from model/model_api_sign_tx_result.go rename to model_api_sign_tx_result.go index f85ab09..5b39d85 100644 --- a/model/model_api_sign_tx_result.go +++ b/model_api_sign_tx_result.go @@ -7,8 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // ApiSignTxResult struct for ApiSignTxResult type ApiSignTxResult struct { Data string `json:"data"` diff --git a/model/model_api_start_sync_result.go b/model_api_start_sync_result.go similarity index 85% rename from model/model_api_start_sync_result.go rename to model_api_start_sync_result.go index 1baf98c..669618c 100644 --- a/model/model_api_start_sync_result.go +++ b/model_api_start_sync_result.go @@ -7,10 +7,9 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // ApiStartSyncResult struct for ApiStartSyncResult type ApiStartSyncResult struct { - Error string `json:"error,omitempty"` + Error string `json:"error,omitempty"` GroupId string `json:"groupId"` } diff --git a/model/model_appapi_create_jwt_params.go b/model_appapi_create_jwt_params.go similarity index 63% rename from model/model_appapi_create_jwt_params.go rename to model_appapi_create_jwt_params.go index 4ad13f3..3af8e96 100644 --- a/model/model_appapi_create_jwt_params.go +++ b/model_appapi_create_jwt_params.go @@ -7,12 +7,11 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // AppapiCreateJwtParams struct for AppapiCreateJwtParams type AppapiCreateJwtParams struct { - AllowGroups []string `json:"allow_groups,omitempty"` - ExpiresAt string `json:"expires_at"` - Name string `json:"name"` - Role string `json:"role"` + ExpiresAt string `json:"expires_at"` + GroupId string `json:"group_id,omitempty"` + Name string `json:"name"` + Role string `json:"role"` } diff --git a/model_appapi_revoke_jwt_params.go b/model_appapi_revoke_jwt_params.go new file mode 100644 index 0000000..410784e --- /dev/null +++ b/model_appapi_revoke_jwt_params.go @@ -0,0 +1,16 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// AppapiRevokeJwtParams struct for AppapiRevokeJwtParams +type AppapiRevokeJwtParams struct { + GroupId string `json:"group_id,omitempty"` + Role string `json:"role"` + Token string `json:"token"` +} diff --git a/model/model_appapi_token_item.go b/model_appapi_token_item.go similarity index 95% rename from model/model_appapi_token_item.go rename to model_appapi_token_item.go index 36ee42b..a54dc1e 100644 --- a/model/model_appapi_token_item.go +++ b/model_appapi_token_item.go @@ -7,8 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // AppapiTokenItem struct for AppapiTokenItem type AppapiTokenItem struct { Token string `json:"token,omitempty"` diff --git a/model_def_rex_sync_result.go b/model_def_rex_sync_result.go new file mode 100644 index 0000000..7871934 --- /dev/null +++ b/model_def_rex_sync_result.go @@ -0,0 +1,19 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// DefRexSyncResult struct for DefRexSyncResult +type DefRexSyncResult struct { + BlockProvided int32 `json:"blockProvided,omitempty"` + FromBlock int32 `json:"fromBlock,omitempty"` + LastSyncTaskTimestamp int32 `json:"lastSyncTaskTimestamp,omitempty"` + NextSyncTaskTimeStamp int32 `json:"nextSyncTaskTimeStamp,omitempty"` + Provider string `json:"provider,omitempty"` + SyncResult string `json:"syncResult,omitempty"` +} diff --git a/model/model_handlers_add_peer_result.go b/model_handlers_add_peer_result.go similarity index 53% rename from model/model_handlers_add_peer_result.go rename to model_handlers_add_peer_result.go index f0bffc6..0ad3def 100644 --- a/model/model_handlers_add_peer_result.go +++ b/model_handlers_add_peer_result.go @@ -7,11 +7,11 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersAddPeerResult struct for HandlersAddPeerResult type HandlersAddPeerResult struct { - ErrCount int64 `json:"err_count,omitempty"` - Error map[string]string `json:"error,omitempty"` - SuccCount int64 `json:"succ_count,omitempty"` + ErrCount int32 `json:"err_count,omitempty"` + // Example: {\"/ip4/132.145.109.63/tcp/10666/p2p/16Uiu2HAmTovb8kAJiYK8saskzz7cRQhb45NRK5AsbtdmYsLfD3RM\": \"error info\"} + Error map[string]string `json:"error,omitempty"` + SuccCount int32 `json:"succ_count,omitempty"` } diff --git a/model/model_handlers_announce_param.go b/model_handlers_announce_param.go similarity index 75% rename from model/model_handlers_announce_param.go rename to model_handlers_announce_param.go index 089cf09..f998bf0 100644 --- a/model/model_handlers_announce_param.go +++ b/model_handlers_announce_param.go @@ -7,12 +7,11 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersAnnounceParam struct for HandlersAnnounceParam type HandlersAnnounceParam struct { - Action string `json:"action"` + Action string `json:"action"` GroupId string `json:"group_id"` - Memo string `json:"memo,omitempty"` - Type string `json:"type"` + Memo string `json:"memo,omitempty"` + Type string `json:"type"` } diff --git a/model/model_handlers_announce_result.go b/model_handlers_announce_result.go similarity index 60% rename from model/model_handlers_announce_result.go rename to model_handlers_announce_result.go index 597c2d0..ed6979c 100644 --- a/model/model_handlers_announce_result.go +++ b/model_handlers_announce_result.go @@ -7,15 +7,14 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersAnnounceResult struct for HandlersAnnounceResult type HandlersAnnounceResult struct { - Action string `json:"action"` + Action string `json:"action"` EncryptPubkey string `json:"encrypt_pubkey,omitempty"` - GroupId string `json:"group_id"` - Sign string `json:"sign"` - SignPubkey string `json:"sign_pubkey"` - TrxId string `json:"trx_id"` - Type string `json:"type"` + GroupId string `json:"group_id"` + Sign string `json:"sign"` + SignPubkey string `json:"sign_pubkey"` + TrxId string `json:"trx_id"` + Type string `json:"type"` } diff --git a/model/model_handlers_announced_producer_list_item.go b/model_handlers_announced_producer_list_item.go similarity index 56% rename from model/model_handlers_announced_producer_list_item.go rename to model_handlers_announced_producer_list_item.go index c5439ce..bf107cb 100644 --- a/model/model_handlers_announced_producer_list_item.go +++ b/model_handlers_announced_producer_list_item.go @@ -7,14 +7,14 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersAnnouncedProducerListItem struct for HandlersAnnouncedProducerListItem type HandlersAnnouncedProducerListItem struct { - Action string `json:"action"` + // ACTION have 2 states: \"ADD\" means Producer is normal, \"REMOVE\" means Producer has announced to leave the group by itself + Action string `json:"action"` AnnouncedPubkey string `json:"announcedPubkey"` - AnnouncerSign string `json:"announcerSign"` - Memo string `json:"memo"` - Result string `json:"result"` - TimeStamp int64 `json:"timeStamp"` + AnnouncerSign string `json:"announcerSign"` + Memo string `json:"memo"` + Result string `json:"result"` + TimeStamp int32 `json:"timeStamp"` } diff --git a/model/model_handlers_announced_user_list_item.go b/model_handlers_announced_user_list_item.go similarity index 56% rename from model/model_handlers_announced_user_list_item.go rename to model_handlers_announced_user_list_item.go index 186371d..4ca3833 100644 --- a/model/model_handlers_announced_user_list_item.go +++ b/model_handlers_announced_user_list_item.go @@ -7,14 +7,13 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersAnnouncedUserListItem struct for HandlersAnnouncedUserListItem type HandlersAnnouncedUserListItem struct { AnnouncedEncryptPubkey string `json:"announcedEncryptPubkey,omitempty"` - AnnouncedSignPubkey string `json:"announcedSignPubkey,omitempty"` - AnnouncerSign string `json:"announcerSign,omitempty"` - Memo string `json:"memo,omitempty"` - Result string `json:"result,omitempty"` - TimeStamp int64 `json:"timeStamp,omitempty"` + AnnouncedSignPubkey string `json:"announcedSignPubkey,omitempty"` + AnnouncerSign string `json:"announcerSign,omitempty"` + Memo string `json:"memo,omitempty"` + Result string `json:"result,omitempty"` + TimeStamp int32 `json:"timeStamp,omitempty"` } diff --git a/model/model_handlers_app_config_key_item.go b/model_handlers_app_config_key_item.go similarity index 56% rename from model/model_handlers_app_config_key_item.go rename to model_handlers_app_config_key_item.go index deeedda..58efa9c 100644 --- a/model/model_handlers_app_config_key_item.go +++ b/model_handlers_app_config_key_item.go @@ -7,15 +7,14 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersAppConfigKeyItem struct for HandlersAppConfigKeyItem type HandlersAppConfigKeyItem struct { - Memo string `json:"memo,omitempty"` - Name string `json:"name,omitempty"` + Memo string `json:"memo,omitempty"` + Name string `json:"name,omitempty"` OwnerPubkey string `json:"ownerPubkey,omitempty"` - OwnerSign string `json:"ownerSign,omitempty"` - TimeStamp int64 `json:"timeStamp,omitempty"` - Type string `json:"type,omitempty"` - Value string `json:"value,omitempty"` + OwnerSign string `json:"ownerSign,omitempty"` + TimeStamp int32 `json:"timeStamp,omitempty"` + Type string `json:"type,omitempty"` + Value string `json:"value,omitempty"` } diff --git a/model/model_handlers_app_config_key_list_item.go b/model_handlers_app_config_key_list_item.go similarity index 96% rename from model/model_handlers_app_config_key_list_item.go rename to model_handlers_app_config_key_list_item.go index b48b8b5..d75d281 100644 --- a/model/model_handlers_app_config_key_list_item.go +++ b/model_handlers_app_config_key_list_item.go @@ -7,8 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersAppConfigKeyListItem struct for HandlersAppConfigKeyListItem type HandlersAppConfigKeyListItem struct { Name string `json:"name,omitempty"` diff --git a/model/model_handlers_app_config_param.go b/model_handlers_app_config_param.go similarity index 66% rename from model/model_handlers_app_config_param.go rename to model_handlers_app_config_param.go index f55eab3..2734e25 100644 --- a/model/model_handlers_app_config_param.go +++ b/model_handlers_app_config_param.go @@ -7,14 +7,13 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersAppConfigParam struct for HandlersAppConfigParam type HandlersAppConfigParam struct { - Action string `json:"action"` + Action string `json:"action"` GroupId string `json:"group_id"` - Memo string `json:"memo,omitempty"` - Name string `json:"name"` - Type string `json:"type"` - Value string `json:"value"` + Memo string `json:"memo,omitempty"` + Name string `json:"name"` + Type string `json:"type"` + Value string `json:"value"` } diff --git a/model/model_handlers_app_config_result.go b/model_handlers_app_config_result.go similarity index 80% rename from model/model_handlers_app_config_result.go rename to model_handlers_app_config_result.go index a92700d..708d2eb 100644 --- a/model/model_handlers_app_config_result.go +++ b/model_handlers_app_config_result.go @@ -7,11 +7,10 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersAppConfigResult struct for HandlersAppConfigResult type HandlersAppConfigResult struct { - GroupId string `json:"group_id"` + GroupId string `json:"group_id"` Signature string `json:"signature"` - TrxId string `json:"trx_id"` + TrxId string `json:"trx_id"` } diff --git a/model/model_handlers_chain_config_params.go b/model_handlers_chain_config_params.go similarity index 75% rename from model/model_handlers_chain_config_params.go rename to model_handlers_chain_config_params.go index a2bc9e4..47c93a6 100644 --- a/model/model_handlers_chain_config_params.go +++ b/model_handlers_chain_config_params.go @@ -7,12 +7,11 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersChainConfigParams struct for HandlersChainConfigParams type HandlersChainConfigParams struct { - Config string `json:"config"` + Config string `json:"config"` GroupId string `json:"group_id"` - Memo string `json:"memo,omitempty"` - Type string `json:"type"` + Memo string `json:"memo,omitempty"` + Type string `json:"type"` } diff --git a/model/model_handlers_chain_config_result.go b/model_handlers_chain_config_result.go similarity index 74% rename from model/model_handlers_chain_config_result.go rename to model_handlers_chain_config_result.go index 586f0e2..9c70500 100644 --- a/model/model_handlers_chain_config_result.go +++ b/model_handlers_chain_config_result.go @@ -7,12 +7,11 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersChainConfigResult struct for HandlersChainConfigResult type HandlersChainConfigResult struct { - GroupId string `json:"group_id"` + GroupId string `json:"group_id"` OwnerPubkey string `json:"owner_pubkey"` - Signature string `json:"signature"` - TrxId string `json:"trx_id"` + Signature string `json:"signature"` + TrxId string `json:"trx_id"` } diff --git a/model/model_handlers_chain_send_trx_rule_list_item.go b/model_handlers_chain_send_trx_rule_list_item.go similarity index 53% rename from model/model_handlers_chain_send_trx_rule_list_item.go rename to model_handlers_chain_send_trx_rule_list_item.go index 0fad555..f2a7a04 100644 --- a/model/model_handlers_chain_send_trx_rule_list_item.go +++ b/model_handlers_chain_send_trx_rule_list_item.go @@ -7,14 +7,13 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersChainSendTrxRuleListItem struct for HandlersChainSendTrxRuleListItem type HandlersChainSendTrxRuleListItem struct { - GroupOwnerPubkey string `json:"groupOwnerPubkey"` - GroupOwnerSign string `json:"groupOwnerSign"` - Memo string `json:"memo,omitempty"` - Pubkey string `json:"pubkey"` - TimeStamp int64 `json:"timeStamp"` - TrxType []string `json:"trxType"` + GroupOwnerPubkey string `json:"groupOwnerPubkey"` + GroupOwnerSign string `json:"groupOwnerSign"` + Memo string `json:"memo,omitempty"` + Pubkey string `json:"pubkey"` + TimeStamp int32 `json:"timeStamp"` + TrxType []string `json:"trxType"` } diff --git a/model/model_appapi_sender_list.go b/model_handlers_clear_group_data_param.go similarity index 57% rename from model/model_appapi_sender_list.go rename to model_handlers_clear_group_data_param.go index fc653d6..30d147d 100644 --- a/model/model_appapi_sender_list.go +++ b/model_handlers_clear_group_data_param.go @@ -7,9 +7,8 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - -// AppapiSenderList struct for AppapiSenderList -type AppapiSenderList struct { - Senders []string `json:"senders,omitempty"` +package rum_sdk +// HandlersClearGroupDataParam struct for HandlersClearGroupDataParam +type HandlersClearGroupDataParam struct { + GroupId string `json:"group_id"` } diff --git a/model/model_handlers_clear_group_data_result.go b/model_handlers_clear_group_data_result.go similarity index 95% rename from model/model_handlers_clear_group_data_result.go rename to model_handlers_clear_group_data_result.go index 2f3f021..781b338 100644 --- a/model/model_handlers_clear_group_data_result.go +++ b/model_handlers_clear_group_data_result.go @@ -7,8 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersClearGroupDataResult struct for HandlersClearGroupDataResult type HandlersClearGroupDataResult struct { GroupId string `json:"group_id"` diff --git a/model/model_handlers_create_group_param.go b/model_handlers_create_group_param.go similarity index 66% rename from model/model_handlers_create_group_param.go rename to model_handlers_create_group_param.go index 51c510b..35ad723 100644 --- a/model/model_handlers_create_group_param.go +++ b/model_handlers_create_group_param.go @@ -7,12 +7,12 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersCreateGroupParam struct for HandlersCreateGroupParam type HandlersCreateGroupParam struct { - AppKey string `json:"app_key"` - ConsensusType string `json:"consensus_type"` + AppKey string `json:"app_key"` + ConsensusType string `json:"consensus_type"` EncryptionType string `json:"encryption_type"` - GroupName string `json:"group_name"` + GroupName string `json:"group_name"` + IncludeChainUrl bool `json:"include_chain_url,omitempty"` } diff --git a/model/model_handlers_create_group_result.go b/model_handlers_create_group_result.go similarity index 86% rename from model/model_handlers_create_group_result.go rename to model_handlers_create_group_result.go index 5d7eecb..8a2cd77 100644 --- a/model/model_handlers_create_group_result.go +++ b/model_handlers_create_group_result.go @@ -7,10 +7,10 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersCreateGroupResult struct for HandlersCreateGroupResult type HandlersCreateGroupResult struct { GroupId string `json:"group_id"` - Seed string `json:"seed"` + // seed url + Seed string `json:"seed"` } diff --git a/model/model_handlers_get_group_seed_result.go b/model_handlers_get_group_seed_result.go similarity index 95% rename from model/model_handlers_get_group_seed_result.go rename to model_handlers_get_group_seed_result.go index af9c6ea..9bbb54e 100644 --- a/model/model_handlers_get_group_seed_result.go +++ b/model_handlers_get_group_seed_result.go @@ -7,8 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersGetGroupSeedResult struct for HandlersGetGroupSeedResult type HandlersGetGroupSeedResult struct { // seed url diff --git a/model/model_handlers_group_network_info.go b/model_handlers_group_network_info.go similarity index 72% rename from model/model_handlers_group_network_info.go rename to model_handlers_group_network_info.go index 519e56d..d013a8b 100644 --- a/model/model_handlers_group_network_info.go +++ b/model_handlers_group_network_info.go @@ -7,11 +7,10 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersGroupNetworkInfo struct for HandlersGroupNetworkInfo type HandlersGroupNetworkInfo struct { - GroupId string `json:"GroupId"` - GroupName string `json:"GroupName"` - Peers []string `json:"Peers"` + GroupId string `json:"GroupId"` + GroupName string `json:"GroupName"` + Peers []string `json:"Peers"` } diff --git a/model/model_handlers_grp_producer_param.go b/model_handlers_grp_producer_param.go similarity index 63% rename from model/model_handlers_grp_producer_param.go rename to model_handlers_grp_producer_param.go index 7c9fc2a..695c40f 100644 --- a/model/model_handlers_grp_producer_param.go +++ b/model_handlers_grp_producer_param.go @@ -7,12 +7,10 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersGrpProducerParam struct for HandlersGrpProducerParam type HandlersGrpProducerParam struct { - Action string `json:"action"` - GroupId string `json:"group_id"` - Memo string `json:"memo,omitempty"` - ProducerPubkey string `json:"producer_pubkey"` + GroupId string `json:"group_id"` + Memo string `json:"memo,omitempty"` + ProducerPubkey []string `json:"producer_pubkey"` } diff --git a/model/model_handlers_grp_producer_result.go b/model_handlers_grp_producer_result.go similarity index 51% rename from model/model_handlers_grp_producer_result.go rename to model_handlers_grp_producer_result.go index b6f3c2b..ae93e93 100644 --- a/model/model_handlers_grp_producer_result.go +++ b/model_handlers_grp_producer_result.go @@ -7,15 +7,12 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersGrpProducerResult struct for HandlersGrpProducerResult type HandlersGrpProducerResult struct { - Action string `json:"action"` - GroupId string `json:"group_id"` - Memo string `json:"memo,omitempty"` - OwnerPubkey string `json:"owner_pubkey"` - ProducerPubkey string `json:"producer_pubkey"` - Signature string `json:"signature"` - TrxId string `json:"trx_id"` + FailableProducers int32 `json:"failable_producers"` + GroupId string `json:"group_id"` + Memo string `json:"memo,omitempty"` + Producers []PbProducerItem `json:"producers,omitempty"` + TrxId string `json:"trx_id"` } diff --git a/model/model_handlers_join_group_param_v2.go b/model_handlers_join_group_param_v2.go similarity index 95% rename from model/model_handlers_join_group_param_v2.go rename to model_handlers_join_group_param_v2.go index b639ac0..52bbfd2 100644 --- a/model/model_handlers_join_group_param_v2.go +++ b/model_handlers_join_group_param_v2.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model +package rum_sdk // HandlersJoinGroupParamV2 struct for HandlersJoinGroupParamV2 type HandlersJoinGroupParamV2 struct { // seed url diff --git a/model/model_handlers_leave_group_param.go b/model_handlers_leave_group_param.go similarity index 95% rename from model/model_handlers_leave_group_param.go rename to model_handlers_leave_group_param.go index 10f154a..542e235 100644 --- a/model/model_handlers_leave_group_param.go +++ b/model_handlers_leave_group_param.go @@ -7,8 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersLeaveGroupParam struct for HandlersLeaveGroupParam type HandlersLeaveGroupParam struct { GroupId string `json:"group_id"` diff --git a/model/model_handlers_leave_group_result.go b/model_handlers_leave_group_result.go similarity index 95% rename from model/model_handlers_leave_group_result.go rename to model_handlers_leave_group_result.go index f5875bd..6f3658e 100644 --- a/model/model_handlers_leave_group_result.go +++ b/model_handlers_leave_group_result.go @@ -7,8 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersLeaveGroupResult struct for HandlersLeaveGroupResult type HandlersLeaveGroupResult struct { GroupId string `json:"group_id"` diff --git a/model_handlers_network_info.go b/model_handlers_network_info.go new file mode 100644 index 0000000..dcbfea0 --- /dev/null +++ b/model_handlers_network_info.go @@ -0,0 +1,21 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// HandlersNetworkInfo struct for HandlersNetworkInfo +type HandlersNetworkInfo struct { + // Example: [\"/ip4/192.168.20.17/tcp/7002\", \"/ip4/127.0.0.1/tcp/7002\"] + Addrs []string `json:"addrs"` + EthAddr string `json:"eth_addr"` + Groups []HandlersGroupNetworkInfo `json:"groups"` + NatEnabled bool `json:"nat_enabled"` + NatType string `json:"nat_type"` + Node map[string]map[string]interface{} `json:"node"` + PeerId string `json:"peer_id"` +} diff --git a/model_handlers_node_info.go b/model_handlers_node_info.go new file mode 100644 index 0000000..060106f --- /dev/null +++ b/model_handlers_node_info.go @@ -0,0 +1,21 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// HandlersNodeInfo struct for HandlersNodeInfo +type HandlersNodeInfo struct { + Mem HandlersNodeInfoMem `json:"mem,omitempty"` + NodeId string `json:"node_id"` + NodePublickey string `json:"node_publickey"` + NodeStatus string `json:"node_status"` + NodeType string `json:"node_type"` + NodeVersion string `json:"node_version"` + // Example: {\"/quorum/nevis/meshsub/1.1.0\": [\"16Uiu2HAmM4jFjs5EjakvGgJkHS6Lg9jS6miNYPgJ3pMUvXGWXeTc\"]} + Peers map[string][]string `json:"peers"` +} diff --git a/model_handlers_node_info_mem.go b/model_handlers_node_info_mem.go new file mode 100644 index 0000000..b77257d --- /dev/null +++ b/model_handlers_node_info_mem.go @@ -0,0 +1,26 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// HandlersNodeInfoMem struct for HandlersNodeInfoMem +type HandlersNodeInfoMem struct { + // OS memory being used + HeapAlloc int32 `json:"heap_alloc,omitempty"` + // OS memory being used + HeapInuse int32 `json:"heap_inuse,omitempty"` + // OS memory being used + HeapSys int32 `json:"heap_sys,omitempty"` + NumGc int32 `json:"num_gc,omitempty"` + // OS memory being used + StackInuse int32 `json:"stack_inuse,omitempty"` + // OS memory being used + StackSys int32 `json:"stack_sys,omitempty"` + // OS memory being used + Sys int32 `json:"sys,omitempty"` +} diff --git a/model_handlers_post_to_group_param.go b/model_handlers_post_to_group_param.go new file mode 100644 index 0000000..6451a3b --- /dev/null +++ b/model_handlers_post_to_group_param.go @@ -0,0 +1,16 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// HandlersPostToGroupParam struct for HandlersPostToGroupParam +type HandlersPostToGroupParam struct { + // Data Example: { \"type\": \"Create\", \"object\": { \"type\": \"Note\", \"id\": 1, \"content\": \"hello world\" } } + Data map[string]map[string]interface{} `json:"data"` + GroupId string `json:"group_id"` +} diff --git a/model/model_handlers_producer_list_item.go b/model_handlers_producer_list_item.go similarity index 62% rename from model/model_handlers_producer_list_item.go rename to model_handlers_producer_list_item.go index ad02195..65881ca 100644 --- a/model/model_handlers_producer_list_item.go +++ b/model_handlers_producer_list_item.go @@ -7,13 +7,12 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersProducerListItem struct for HandlersProducerListItem type HandlersProducerListItem struct { - BlockProduced int64 `json:"blockProduced,omitempty"` - OwnerPubkey string `json:"ownerPubkey,omitempty"` - OwnerSign string `json:"ownerSign,omitempty"` + BlockWithness int32 `json:"blockWithness,omitempty"` + OwnerPubkey string `json:"ownerPubkey,omitempty"` + OwnerSign string `json:"ownerSign,omitempty"` ProducerPubkey string `json:"producerPubkey,omitempty"` - TimeStamp int64 `json:"timeStamp,omitempty"` + TimeStamp int32 `json:"timeStamp,omitempty"` } diff --git a/model/model_handlers_trx_auth_item.go b/model_handlers_trx_auth_item.go similarity index 85% rename from model/model_handlers_trx_auth_item.go rename to model_handlers_trx_auth_item.go index 0af0e17..b27f87b 100644 --- a/model/model_handlers_trx_auth_item.go +++ b/model_handlers_trx_auth_item.go @@ -7,10 +7,9 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersTrxAuthItem struct for HandlersTrxAuthItem type HandlersTrxAuthItem struct { AuthType string `json:"authType,omitempty"` - TrxType string `json:"trxType,omitempty"` + TrxType string `json:"trxType,omitempty"` } diff --git a/model/model_handlers_trx_result.go b/model_handlers_trx_result.go similarity index 95% rename from model/model_handlers_trx_result.go rename to model_handlers_trx_result.go index 6705e19..d20184b 100644 --- a/model/model_handlers_trx_result.go +++ b/model_handlers_trx_result.go @@ -7,8 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - +package rum_sdk // HandlersTrxResult struct for HandlersTrxResult type HandlersTrxResult struct { TrxId string `json:"trx_id"` diff --git a/model_options_jwt.go b/model_options_jwt.go new file mode 100644 index 0000000..b8c7f4a --- /dev/null +++ b/model_options_jwt.go @@ -0,0 +1,16 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// OptionsJwt struct for OptionsJwt +type OptionsJwt struct { + Chain OptionsJwtListItem `json:"chain,omitempty"` + Key string `json:"key,omitempty"` + Node map[string]OptionsJwtListItem `json:"node,omitempty"` +} diff --git a/model_options_jwt_list_item.go b/model_options_jwt_list_item.go new file mode 100644 index 0000000..5f4a51e --- /dev/null +++ b/model_options_jwt_list_item.go @@ -0,0 +1,15 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// OptionsJwtListItem struct for OptionsJwtListItem +type OptionsJwtListItem struct { + Normal []OptionsTokenItem `json:"normal,omitempty"` + Revoke []OptionsTokenItem `json:"revoke,omitempty"` +} diff --git a/model/model_api_ps_ping_param.go b/model_options_token_item.go similarity index 56% rename from model/model_api_ps_ping_param.go rename to model_options_token_item.go index 645a4cc..f1fd2ee 100644 --- a/model/model_api_ps_ping_param.go +++ b/model_options_token_item.go @@ -7,9 +7,9 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - -// ApiPsPingParam struct for ApiPsPingParam -type ApiPsPingParam struct { - PeerId string `json:"peer_id"` +package rum_sdk +// OptionsTokenItem struct for OptionsTokenItem +type OptionsTokenItem struct { + Remark string `json:"remark,omitempty"` + Token string `json:"token,omitempty"` } diff --git a/model_pb_announce_item.go b/model_pb_announce_item.go new file mode 100644 index 0000000..393e5d7 --- /dev/null +++ b/model_pb_announce_item.go @@ -0,0 +1,24 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// PbAnnounceItem struct for PbAnnounceItem +type PbAnnounceItem struct { + Action int32 `json:"Action,omitempty"` + AnnouncerSignature string `json:"AnnouncerSignature,omitempty"` + EncryptPubkey string `json:"EncryptPubkey,omitempty"` + GroupId string `json:"GroupId,omitempty"` + Memo string `json:"Memo,omitempty"` + OwnerPubkey string `json:"OwnerPubkey,omitempty"` + OwnerSignature string `json:"OwnerSignature,omitempty"` + Result int32 `json:"Result,omitempty"` + SignPubkey string `json:"SignPubkey,omitempty"` + TimeStamp string `json:"TimeStamp,omitempty"` + Type int32 `json:"Type,omitempty"` +} diff --git a/model_pb_block.go b/model_pb_block.go new file mode 100644 index 0000000..599f3e1 --- /dev/null +++ b/model_pb_block.go @@ -0,0 +1,23 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// PbBlock struct for PbBlock +type PbBlock struct { + BlockHash []int32 `json:"BlockHash,omitempty"` + BlockId int32 `json:"BlockId,omitempty"` + Epoch int32 `json:"Epoch,omitempty"` + GroupId string `json:"GroupId,omitempty"` + PrevHash []int32 `json:"PrevHash,omitempty"` + ProducerPubkey string `json:"ProducerPubkey,omitempty"` + ProducerSign []int32 `json:"ProducerSign,omitempty"` + Sudo bool `json:"Sudo,omitempty"` + TimeStamp string `json:"TimeStamp,omitempty"` + Trxs []PbTrx `json:"Trxs,omitempty"` +} diff --git a/model_pb_producer_item.go b/model_pb_producer_item.go new file mode 100644 index 0000000..ffd49a8 --- /dev/null +++ b/model_pb_producer_item.go @@ -0,0 +1,21 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// PbProducerItem struct for PbProducerItem +type PbProducerItem struct { + Action int32 `json:"Action,omitempty"` + GroupId string `json:"GroupId,omitempty"` + GroupOwnerPubkey string `json:"GroupOwnerPubkey,omitempty"` + GroupOwnerSign string `json:"GroupOwnerSign,omitempty"` + Memo string `json:"Memo,omitempty"` + ProducerPubkey string `json:"ProducerPubkey,omitempty"` + TimeStamp string `json:"TimeStamp,omitempty"` + WithnessBlocks int32 `json:"WithnessBlocks,omitempty"` +} diff --git a/model_pb_trx.go b/model_pb_trx.go new file mode 100644 index 0000000..9288713 --- /dev/null +++ b/model_pb_trx.go @@ -0,0 +1,24 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk +// PbTrx struct for PbTrx +type PbTrx struct { + Data []int32 `json:"Data,omitempty"` + Expired int32 `json:"Expired,omitempty"` + GroupId string `json:"GroupId,omitempty"` + ResendCount int32 `json:"ResendCount,omitempty"` + SenderPubkey string `json:"SenderPubkey,omitempty"` + SenderSign []int32 `json:"SenderSign,omitempty"` + StorageType int32 `json:"StorageType,omitempty"` + TimeStamp string `json:"TimeStamp,omitempty"` + TrxId string `json:"TrxId,omitempty"` + Type int32 `json:"Type,omitempty"` + Version string `json:"Version,omitempty"` +} diff --git a/model/model_api_p2_p_ping_param.go b/model_utils_success_response.go similarity index 60% rename from model/model_api_p2_p_ping_param.go rename to model_utils_success_response.go index 9b6cf00..cca5a30 100644 --- a/model/model_api_p2_p_ping_param.go +++ b/model_utils_success_response.go @@ -7,9 +7,8 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package model - -// ApiP2PPingParam struct for ApiP2PPingParam -type ApiP2PPingParam struct { - PeerId string `json:"peer_id"` +package rum_sdk +// UtilsSuccessResponse struct for UtilsSuccessResponse +type UtilsSuccessResponse struct { + Success bool `json:"success,omitempty"` } diff --git a/node.go b/node.go deleted file mode 100644 index 25fa3c1..0000000 --- a/node.go +++ /dev/null @@ -1,65 +0,0 @@ -package rumgosdk - -import "github.com/tymon42/rum-go-sdk/model" - -// GetNode info, /api/v1/node -func (q *Quorum) GetNode() (*model.HandlersNodeInfo, error) { - url := q.ApiServer + "/api/v1/node" - res := &model.HandlersNodeInfo{} - _, err := q.HttpClient.R().SetResult(res).Get(url) - if err != nil { - return nil, err - } - return res, nil -} - -// GetNetwork gets node network info, /api/v1/network -func (q *Quorum) GetNetwork() (*model.HandlersNetworkInfo, error) { - url := q.ApiServer + "/api/v1/network" - res := &model.HandlersNetworkInfo{} - _, err := q.HttpClient.R().SetResult(res).Get(url) - if err != nil { - return nil, err - } - return res, nil -} - -// AddPeers adds peers to the node, /api/v1/network/peers -func (q *Quorum) AddPeers(peers []string) error { - url := q.ApiServer + "/api/v1/network/peers" - _, err := q.HttpClient.R().SetBody(peers).Post(url) - return err -} - -// PingPeers pings peers, /api/v1/network/peers/ping -func (q *Quorum) PingPeers() (*model.ApiAddrProtoPair, error) { - url := q.ApiServer + "/api/v1/network/peers/ping" - res := &model.ApiAddrProtoPair{} - _, err := q.HttpClient.R().SetResult(res).Get(url) - if err != nil { - return nil, err - } - return res, nil -} - -// AddRelayServers adds relay servers to the node, /api/v1/network/relay -func (q *Quorum) AddRelayServers(relayServers []string) (*model.ApiAddRelayServersResp, error) { - url := q.ApiServer + "/api/v1/network/relay" - res := &model.ApiAddRelayServersResp{} - _, err := q.HttpClient.R().SetBody(relayServers).SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, nil -} - -// PubsubPing pings pubsub, /api/v1/psping -func (q *Quorum) PubsubPing(data model.ApiPsPingParam) (*model.HandlersPingResp, error) { - url := q.ApiServer + "/api/v1/psping" - res := &model.HandlersPingResp{} - _, err := q.HttpClient.R().SetBody(data).SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, nil -} diff --git a/node_test.go b/node_test.go deleted file mode 100644 index 0d128d9..0000000 --- a/node_test.go +++ /dev/null @@ -1,163 +0,0 @@ -package rumgosdk - -import ( - "fmt" - "reflect" - "testing" - - "github.com/go-resty/resty/v2" - "github.com/tymon42/rum-go-sdk/model" -) - -func TestQuorum_Node(t *testing.T) { - type fields struct { - ApiServer string - HttpClient *resty.Client - } - tests := []struct { - name string - fields fields - want *model.HandlersNodeInfo - wantErr bool - }{ - { - name: "Test Quorum Node", - fields: fields{ - ApiServer: "http://localhost:8002", - HttpClient: resty.New(), - }, - wantErr: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - q := &Quorum{ - ApiServer: tt.fields.ApiServer, - HttpClient: tt.fields.HttpClient, - } - got, err := q.GetNode() - if (err != nil) != tt.wantErr { - t.Errorf("Quorum.Node() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Quorum.Node() = %v, want %v", got, tt.want) - } - }) - } -} - -func TestQuorum_GetNetwork(t *testing.T) { - type fields struct { - ApiServer string - HttpClient *resty.Client - } - tests := []struct { - name string - fields fields - want *model.HandlersNetworkInfo - wantErr bool - }{ - { - name: "Test Quorum Network", - fields: fields{ - ApiServer: "http://localhost:8002", - HttpClient: resty.New(), - }, - wantErr: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - q := &Quorum{ - ApiServer: tt.fields.ApiServer, - HttpClient: tt.fields.HttpClient, - } - got, err := q.GetNetwork() - if (err != nil) != tt.wantErr { - t.Errorf("Quorum.GetNetwork() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Quorum.GetNetwork() = %v, want %v", got, tt.want) - } - }) - } -} - -func TestQuorum_AddPeers(t *testing.T) { - peers := []string{"/ip4/94.23.17.189/tcp/10666/p2p/16Uiu2HAmGTcDnhj3KVQUwVx8SGLyKBXQwfAxNayJdEwfsnUYKK4u"} - type fields struct { - ApiServer string - HttpClient *resty.Client - } - type args struct { - peers []string - } - tests := []struct { - name string - fields fields - args args - wantErr bool - }{ - { - name: "Test Quorum AddPeers", - fields: fields{ - ApiServer: "http://localhost:8002", - HttpClient: resty.New(), - }, - args: args{ - peers: peers, - }, - wantErr: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - q := &Quorum{ - ApiServer: tt.fields.ApiServer, - HttpClient: tt.fields.HttpClient, - } - if err := q.AddPeers(tt.args.peers); (err != nil) != tt.wantErr { - t.Errorf("Quorum.AddPeers() error = %v, wantErr %v", err, tt.wantErr) - } - }) - } -} - -func TestQuorum_PingPeers(t *testing.T) { - type fields struct { - ApiServer string - HttpClient *resty.Client - } - tests := []struct { - name string - fields fields - want *model.ApiAddrProtoPair - wantErr bool - }{ - { - name: "Test Quorum PingPeers", - fields: fields{ - ApiServer: "http://localhost:8002", - HttpClient: resty.New(), - }, - wantErr: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - q := &Quorum{ - ApiServer: tt.fields.ApiServer, - HttpClient: tt.fields.HttpClient, - } - got, err := q.PingPeers() - if (err != nil) != tt.wantErr { - t.Errorf("Quorum.PingPeers() error = %v, wantErr %v", err, tt.wantErr) - return - } else { - fmt.Println(got) - } - }) - } -} diff --git a/response.go b/response.go new file mode 100644 index 0000000..2cb9b65 --- /dev/null +++ b/response.go @@ -0,0 +1,46 @@ +/* + * rum + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package rum_sdk + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResonse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/tools.go b/tools.go deleted file mode 100644 index 9b2774a..0000000 --- a/tools.go +++ /dev/null @@ -1,18 +0,0 @@ -package rumgosdk - -import ( - "github.com/tymon42/rum-go-sdk/model" -) - -// PubkeyToEthaddr converts a based64 encoded libp2p pubkey to an ethereum address, /api/v1/tools/pubkeytoaddr -// Param: apiPubkeyParam -// Return: map[string]string -func (q *Quorum) PubkeyToEthaddr(param *model.ApiPubkeyParam) (map[string]string, error) { - url := q.ApiServer + "/api/v1/tools/pubkeytoaddr" - res := map[string]string{} - _, err := q.HttpClient.R().SetBody(param).SetResult(&res).Post(url) - if err != nil { - return nil, err - } - return res, err -} diff --git a/user.go b/user.go deleted file mode 100644 index f7a96fe..0000000 --- a/user.go +++ /dev/null @@ -1,67 +0,0 @@ -package rumgosdk - -import ( - "github.com/tymon42/rum-go-sdk/model" -) - -// AnnounceUserPubkey announces user pubkey, /api/v1/group/announce -// param: handlersAnnounceParam -// return: HandlersAnnounceResult -func (q *Quorum) AnnounceUserPubkey(param model.HandlersAnnounceParam) (*model.HandlersAnnounceResult, error) { - url := q.ApiServer + "/api/v1/group/announce" - res := &model.HandlersAnnounceResult{} - _, err := q.HttpClient.R().SetBody(param).SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, nil -} - -// UpdateProfile updates profile, /api/v1/group/profile -// param: pbActivity -// return: HandlersUpdateProfileResult -func (q *Quorum) UpdateProfile(param model.PbActivity) (*model.HandlersUpdateProfileResult, error) { - url := q.ApiServer + "/api/v1/group/profile" - res := &model.HandlersUpdateProfileResult{} - _, err := q.HttpClient.R().SetBody(param).SetResult(res).Post(url) - if err != nil { - return nil, err - } - return res, nil -} - -// GetAnnouncedGroupProducer gets announced group producer, /api/v1/group/{group_id}/producers -// return []HandlersAnnouncedProdcerListItempbGroupProducer -func (q *Quorum) GetAnnouncedGroupProducer(group_id string) ([]model.HandlersAnnouncedProducerListItem, error) { - url := q.ApiServer + "/api/v1/group/" + group_id + "/producers" - res := []model.HandlersAnnouncedProducerListItem{} - _, err := q.HttpClient.R().SetResult(res).Get(url) - if err != nil { - return nil, err - } - return res, nil -} - -// GetAnnouncedGroupUser gets announced group user, /api/v1/group/{group_id}/announced/user/{sign_pubkey} -// return: HandlersAnnouncedUserListResult -func (q *Quorum) GetAnnouncedGroupUser(group_id string, sign_pubkey string) (*model.HandlersAnnouncedUserListItem, error) { - url := q.ApiServer + "/api/v1/group/" + group_id + "/announced/user/" + sign_pubkey - res := &model.HandlersAnnouncedUserListItem{} - _, err := q.HttpClient.R().SetResult(res).Get(url) - if err != nil { - return nil, err - } - return res, nil -} - -// GetAnnouncedGroupUsers gets announced group users, /api/v1/group/{group_id}/announced/users -// return: HandlersAnnouncedUserListItem -func (q *Quorum) GetAnnouncedGroupUsers(group_id string) (*model.HandlersAnnouncedUserListItem, error) { - url := q.ApiServer + "/api/v1/group/" + group_id + "/announced/users" - res := &model.HandlersAnnouncedUserListItem{} - _, err := q.HttpClient.R().SetResult(res).Get(url) - if err != nil { - return nil, err - } - return res, nil -}