Generate yookassa client via openapi tool ogen
This commit is contained in:
46
go.mod
46
go.mod
@@ -1,19 +1,25 @@
|
||||
module payouts
|
||||
|
||||
go 1.24.4
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/go-faster/errors v0.7.1
|
||||
github.com/go-faster/jx v1.2.0
|
||||
github.com/go-viper/encoding/javaproperties v0.1.0
|
||||
github.com/go-viper/mapstructure/v2 v2.5.0
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/gorilla/mux v1.8.1
|
||||
github.com/jellydator/ttlcache/v3 v3.4.0
|
||||
github.com/jinzhu/copier v0.4.0
|
||||
github.com/ogen-go/ogen v1.20.1
|
||||
github.com/ogier/pflag v0.0.1
|
||||
github.com/orandin/slog-gorm v1.4.0
|
||||
github.com/prometheus/client_golang v1.23.2
|
||||
github.com/samber/slog-multi v1.7.1
|
||||
github.com/spf13/viper v1.21.0
|
||||
go.opentelemetry.io/otel v1.42.0
|
||||
go.opentelemetry.io/otel/metric v1.42.0
|
||||
go.opentelemetry.io/otel/trace v1.42.0
|
||||
go.uber.org/fx v1.24.0
|
||||
golang.org/x/crypto v0.48.0
|
||||
gorm.io/driver/postgres v1.6.0
|
||||
@@ -24,35 +30,69 @@ require (
|
||||
require (
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/dlclark/regexp2 v1.11.5 // indirect
|
||||
github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect
|
||||
github.com/fatih/color v1.18.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.9.0 // indirect
|
||||
github.com/getkin/kin-openapi v0.133.0 // indirect
|
||||
github.com/ghodss/yaml v1.0.0 // indirect
|
||||
github.com/go-faster/yaml v0.4.6 // indirect
|
||||
github.com/go-logr/logr v1.4.3 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
||||
github.com/go-openapi/swag v0.23.0 // indirect
|
||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
||||
github.com/jackc/pgx/v5 v5.6.0 // indirect
|
||||
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/magiconair/properties v1.8.7 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mattn/go-sqlite3 v1.14.22 // indirect
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/oapi-codegen/oapi-codegen/v2 v2.6.0 // indirect
|
||||
github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 // indirect
|
||||
github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
|
||||
github.com/perimeterx/marshmallow v1.1.5 // indirect
|
||||
github.com/prometheus/client_model v0.6.2 // indirect
|
||||
github.com/prometheus/common v0.66.1 // indirect
|
||||
github.com/prometheus/procfs v0.16.1 // indirect
|
||||
github.com/sagikazarmark/locafero v0.11.0 // indirect
|
||||
github.com/samber/lo v1.52.0 // indirect
|
||||
github.com/samber/slog-common v0.20.0 // indirect
|
||||
github.com/segmentio/asm v1.2.1 // indirect
|
||||
github.com/shopspring/decimal v1.4.0 // indirect
|
||||
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
|
||||
github.com/speakeasy-api/jsonpath v0.6.0 // indirect
|
||||
github.com/speakeasy-api/openapi-overlay v0.10.2 // indirect
|
||||
github.com/spf13/afero v1.15.0 // indirect
|
||||
github.com/spf13/cast v1.10.0 // indirect
|
||||
github.com/spf13/pflag v1.0.10 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect
|
||||
github.com/woodsbury/decimal128 v1.3.0 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
||||
go.uber.org/dig v1.19.0 // indirect
|
||||
go.uber.org/multierr v1.10.0 // indirect
|
||||
go.uber.org/zap v1.26.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.27.1 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.2 // indirect
|
||||
go.yaml.in/yaml/v3 v3.0.4 // indirect
|
||||
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 // indirect
|
||||
golang.org/x/mod v0.33.0 // indirect
|
||||
golang.org/x/net v0.51.0 // indirect
|
||||
golang.org/x/sync v0.19.0 // indirect
|
||||
golang.org/x/sys v0.41.0 // indirect
|
||||
golang.org/x/text v0.34.0 // indirect
|
||||
golang.org/x/tools v0.42.0 // indirect
|
||||
google.golang.org/protobuf v1.36.8 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen
|
||||
|
||||
202
go.sum
202
go.sum
@@ -2,23 +2,73 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ=
|
||||
github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
|
||||
github.com/dprotaso/go-yit v0.0.0-20191028211022-135eb7262960/go.mod h1:9HQzr9D/0PGwMEbC3d5AB7oi67+h4TsQqItC1GVYG58=
|
||||
github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 h1:PRxIJD8XjimM5aTknUK9w6DHLDox2r2M3DI4i2pnd3w=
|
||||
github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936/go.mod h1:ttYvX5qlB+mlV1okblJqcSMtR4c52UKxDiX9GRBS8+Q=
|
||||
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
|
||||
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
|
||||
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
|
||||
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
|
||||
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
|
||||
github.com/getkin/kin-openapi v0.133.0 h1:pJdmNohVIJ97r4AUFtEXRXwESr8b0bD721u/Tz6k8PQ=
|
||||
github.com/getkin/kin-openapi v0.133.0/go.mod h1:boAciF6cXk5FhPqe/NQeBTeenbjqU4LhWBf09ILVvWE=
|
||||
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/go-faster/errors v0.7.1 h1:MkJTnDoEdi9pDabt1dpWf7AA8/BaSYZqibYyhZ20AYg=
|
||||
github.com/go-faster/errors v0.7.1/go.mod h1:5ySTjWFiphBs07IKuiL69nxdfd5+fzh1u7FPGZP2quo=
|
||||
github.com/go-faster/jx v1.2.0 h1:T2YHJPrFaYu21fJtUxC9GzmluKu8rVIFDwwGBKTDseI=
|
||||
github.com/go-faster/jx v1.2.0/go.mod h1:UWLOVDmMG597a5tBFPLIWJdUxz5/2emOpfsj9Neg0PE=
|
||||
github.com/go-faster/yaml v0.4.6 h1:lOK/EhI04gCpPgPhgt0bChS6bvw7G3WwI8xxVe0sw9I=
|
||||
github.com/go-faster/yaml v0.4.6/go.mod h1:390dRIvV4zbnO7qC9FGo6YYutc+wyyUSHBgbXL52eXk=
|
||||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
|
||||
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
|
||||
github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
|
||||
github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
|
||||
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
|
||||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
|
||||
github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=
|
||||
github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
|
||||
github.com/go-viper/encoding/javaproperties v0.1.0 h1:4pQN/pez/rMy9ITZ++SgLH6VIN3zWzNNuWFHKjrpn6w=
|
||||
github.com/go-viper/encoding/javaproperties v0.1.0/go.mod h1:LGaThjx5J/GFdQRJscxLMQsYt0XKAM7IW9YzsJTv6jw=
|
||||
github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro=
|
||||
github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
|
||||
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
||||
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
|
||||
@@ -35,26 +85,65 @@ github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD
|
||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
||||
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
|
||||
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
|
||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||
github.com/klauspost/compress v1.18.2 h1:iiPHWW0YrcFgpBYhsA6D1+fqHssJscY/Tm/y2Uqnapk=
|
||||
github.com/klauspost/compress v1.18.2/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
||||
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
||||
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
|
||||
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
|
||||
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
|
||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
|
||||
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
||||
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
||||
github.com/oapi-codegen/oapi-codegen/v2 v2.6.0 h1:4i+F2cvwBFZeplxCssNdLy3MhNzUD87mI3HnayHZkAU=
|
||||
github.com/oapi-codegen/oapi-codegen/v2 v2.6.0/go.mod h1:eWHeJSohQJIINJZzzQriVynfGsnlQVh0UkN2UYYcw4Q=
|
||||
github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 h1:G7ERwszslrBzRxj//JalHPu/3yz+De2J+4aLtSRlHiY=
|
||||
github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037/go.mod h1:2bpvgLBZEtENV5scfDFEtB/5+1M4hkQhDQrccEJ/qGw=
|
||||
github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 h1:bQx3WeLcUWy+RletIKwUIt4x3t8n2SxavmoclizMb8c=
|
||||
github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o=
|
||||
github.com/ogen-go/ogen v1.20.1 h1:AFpIeI2rS37TNIMRQTHhAkThICQpa1p+Pceu7HP7xsA=
|
||||
github.com/ogen-go/ogen v1.20.1/go.mod h1:eXQeqzIfw9qUjXdpqNtkX+XCvhlWNymqU1bm7S7y8iU=
|
||||
github.com/ogier/pflag v0.0.1 h1:RW6JSWSu/RkSatfcLtogGfFgpim5p7ARQ10ECk5O750=
|
||||
github.com/ogier/pflag v0.0.1/go.mod h1:zkFki7tvTa0tafRvTBIZTvzYyAu6kQhPZFnshFFPE+g=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
|
||||
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
|
||||
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
|
||||
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
|
||||
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
|
||||
github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw=
|
||||
github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
|
||||
github.com/orandin/slog-gorm v1.4.0 h1:FgA8hJufF9/jeNSYoEXmHPPBwET2gwlF3B85JdpsTUU=
|
||||
github.com/orandin/slog-gorm v1.4.0/go.mod h1:MoZ51+b7xE9lwGNPYEhxcUtRNrYzjdcKvA8QXQQGEPA=
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
|
||||
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
|
||||
github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s=
|
||||
github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
|
||||
@@ -65,8 +154,8 @@ github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9Z
|
||||
github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA=
|
||||
github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg=
|
||||
github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is=
|
||||
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
||||
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
|
||||
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
|
||||
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
|
||||
github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=
|
||||
github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=
|
||||
github.com/samber/lo v1.52.0 h1:Rvi+3BFHES3A8meP33VPAxiBZX/Aws5RxrschYGjomw=
|
||||
@@ -75,8 +164,18 @@ github.com/samber/slog-common v0.20.0 h1:WaLnm/aCvBJSk5nR5aXZTFBaV0B47A+AEaEOiZD
|
||||
github.com/samber/slog-common v0.20.0/go.mod h1:+Ozat1jgnnE59UAlmNX1IF3IByHsODnnwf9jUcBZ+m8=
|
||||
github.com/samber/slog-multi v1.7.1 h1:aCLXHRxgU+2v0PVlEOh7phynzM7CRo89ZgFtOwaqVEE=
|
||||
github.com/samber/slog-multi v1.7.1/go.mod h1:A4KQC99deqfkCDJcL/cO3kX6McX7FffQAx/8QHink+c=
|
||||
github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0=
|
||||
github.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
|
||||
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
|
||||
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
|
||||
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
|
||||
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=
|
||||
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=
|
||||
github.com/speakeasy-api/jsonpath v0.6.0 h1:IhtFOV9EbXplhyRqsVhHoBmmYjblIRh5D1/g8DHMXJ8=
|
||||
github.com/speakeasy-api/jsonpath v0.6.0/go.mod h1:ymb2iSkyOycmzKwbEAYPJV/yi2rSmvBCLZJcyD+VVWw=
|
||||
github.com/speakeasy-api/openapi-overlay v0.10.2 h1:VOdQ03eGKeiHnpb1boZCGm7x8Haj6gST0P3SGTX95GU=
|
||||
github.com/speakeasy-api/openapi-overlay v0.10.2/go.mod h1:n0iOU7AqKpNFfEt6tq7qYITC4f0yzVVdFw0S7hukemg=
|
||||
github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=
|
||||
github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=
|
||||
github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=
|
||||
@@ -87,38 +186,125 @@ github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=
|
||||
github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
|
||||
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
||||
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
|
||||
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
|
||||
github.com/vmware-labs/yaml-jsonpath v0.3.2 h1:/5QKeCBGdsInyDCyVNLbXyilb61MXGi9NP674f9Hobk=
|
||||
github.com/vmware-labs/yaml-jsonpath v0.3.2/go.mod h1:U6whw1z03QyqgWdgXxvVnQ90zN1BWz5V+51Ewf8k+rQ=
|
||||
github.com/woodsbury/decimal128 v1.3.0 h1:8pffMNWIlC0O5vbyHWFZAt5yWvWcrHA+3ovIIjVWss0=
|
||||
github.com/woodsbury/decimal128 v1.3.0/go.mod h1:C5UTmyTjW3JftjUFzOVhC20BEQa2a4ZKOB5I6Zjb+ds=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
|
||||
go.opentelemetry.io/otel v1.42.0 h1:lSQGzTgVR3+sgJDAU/7/ZMjN9Z+vUip7leaqBKy4sho=
|
||||
go.opentelemetry.io/otel v1.42.0/go.mod h1:lJNsdRMxCUIWuMlVJWzecSMuNjE7dOYyWlqOXWkdqCc=
|
||||
go.opentelemetry.io/otel/metric v1.42.0 h1:2jXG+3oZLNXEPfNmnpxKDeZsFI5o4J+nz6xUlaFdF/4=
|
||||
go.opentelemetry.io/otel/metric v1.42.0/go.mod h1:RlUN/7vTU7Ao/diDkEpQpnz3/92J9ko05BIwxYa2SSI=
|
||||
go.opentelemetry.io/otel/trace v1.42.0 h1:OUCgIPt+mzOnaUTpOQcBiM/PLQ/Op7oq6g4LenLmOYY=
|
||||
go.opentelemetry.io/otel/trace v1.42.0/go.mod h1:f3K9S+IFqnumBkKhRJMeaZeNk9epyhnCmQh/EysQCdc=
|
||||
go.uber.org/dig v1.19.0 h1:BACLhebsYdpQ7IROQ1AGPjrXcP5dF80U3gKoFzbaq/4=
|
||||
go.uber.org/dig v1.19.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE=
|
||||
go.uber.org/fx v1.24.0 h1:wE8mruvpg2kiiL1Vqd0CC+tr0/24XIB10Iwp2lLWzkg=
|
||||
go.uber.org/fx v1.24.0/go.mod h1:AmDeGyS+ZARGKM4tlH4FY2Jr63VjbEDJHtqXTGP5hbo=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=
|
||||
go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||
go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
|
||||
go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
|
||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||
go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc=
|
||||
go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
||||
go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
|
||||
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
|
||||
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
|
||||
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts=
|
||||
golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos=
|
||||
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 h1:Di6/M8l0O2lCLc6VVRWhgCiApHV8MnQurBnFSHsQtNY=
|
||||
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8=
|
||||
golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
|
||||
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.51.0 h1:94R/GTO7mt3/4wIKpcR5gkGmRLOuE/2hNGeWq/GBIFo=
|
||||
golang.org/x/net v0.51.0/go.mod h1:aamm+2QF5ogm02fjy5Bb7CQ0WMt1/WVM7FtyaTLlA9Y=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
|
||||
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210112080510-489259a85091/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-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
|
||||
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
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/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.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk=
|
||||
golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA=
|
||||
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.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k=
|
||||
golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc=
|
||||
google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20191026110619-0b21df46bc1d/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
||||
347
internal/service/yookassa/gen/oas_cfg_gen.go
Normal file
347
internal/service/yookassa/gen/oas_cfg_gen.go
Normal file
@@ -0,0 +1,347 @@
|
||||
// Code generated by ogen, DO NOT EDIT.
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
ht "github.com/ogen-go/ogen/http"
|
||||
"github.com/ogen-go/ogen/middleware"
|
||||
"github.com/ogen-go/ogen/ogenerrors"
|
||||
"github.com/ogen-go/ogen/ogenregex"
|
||||
"github.com/ogen-go/ogen/otelogen"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/metric"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
|
||||
var regexMap = map[string]ogenregex.Regexp{
|
||||
"(.)([0-9а-яА-Яa-zA-Z]+)(.)": ogenregex.MustCompile("(.)([0-9а-яА-Яa-zA-Z]+)(.)"),
|
||||
"(?s).{1,210}": ogenregex.MustCompile("(?s).{1,210}"),
|
||||
"([\\d]{20})|(0)": ogenregex.MustCompile("([\\d]{20})|(0)"),
|
||||
"([\\d]{8})|(0)": ogenregex.MustCompile("([\\d]{8})|(0)"),
|
||||
"(^00[1-9]{1}$)|(^0[1-6]{1}[0-9]{1}$)|(^07[0-3]{1}$)": ogenregex.MustCompile("(^00[1-9]{1}$)|(^0[1-6]{1}[0-9]{1}$)|(^07[0-3]{1}$)"),
|
||||
"[0-9]{1,150}": ogenregex.MustCompile("[0-9]{1,150}"),
|
||||
"[0-9]{10}": ogenregex.MustCompile("[0-9]{10}"),
|
||||
"[0-9]{11,33}": ogenregex.MustCompile("[0-9]{11,33}"),
|
||||
"[0-9]{14,19}": ogenregex.MustCompile("[0-9]{14,19}"),
|
||||
"[0-9]{16,19}": ogenregex.MustCompile("[0-9]{16,19}"),
|
||||
"[0-9]{24}": ogenregex.MustCompile("[0-9]{24}"),
|
||||
"[0-9]{2}": ogenregex.MustCompile("[0-9]{2}"),
|
||||
"[0-9]{4,15}": ogenregex.MustCompile("[0-9]{4,15}"),
|
||||
"[0-9]{4}": ogenregex.MustCompile("[0-9]{4}"),
|
||||
"[0-9]{6}": ogenregex.MustCompile("[0-9]{6}"),
|
||||
"[0-9]{9}": ogenregex.MustCompile("[0-9]{9}"),
|
||||
"[0-9a-zA-Z+-_.]{1,64}": ogenregex.MustCompile("[0-9a-zA-Z+-_.]{1,64}"),
|
||||
"[A-Z]{3}": ogenregex.MustCompile("[A-Z]{3}"),
|
||||
"[a-zA-Z '-]{0,26}": ogenregex.MustCompile("[a-zA-Z '-]{0,26}"),
|
||||
"[a-zA-Z0-9]{12}": ogenregex.MustCompile("[a-zA-Z0-9]{12}"),
|
||||
"\\d{1,20}": ogenregex.MustCompile("\\d{1,20}"),
|
||||
"\\d{10}|\\d{12}": ogenregex.MustCompile("\\d{10}|\\d{12}"),
|
||||
"\\d{20}": ogenregex.MustCompile("\\d{20}"),
|
||||
"\\d{9}": ogenregex.MustCompile("\\d{9}"),
|
||||
"^[0]{1}$": ogenregex.MustCompile("^[0]{1}$"),
|
||||
"^[\\-a-zA-Zа-яёА-ЯЁ ]]*$": ogenregex.MustCompile("^[\\-a-zA-Zа-яёА-ЯЁ ]]*$"),
|
||||
}
|
||||
var (
|
||||
// Allocate option closure once.
|
||||
clientSpanKind = trace.WithSpanKind(trace.SpanKindClient)
|
||||
// Allocate option closure once.
|
||||
serverSpanKind = trace.WithSpanKind(trace.SpanKindServer)
|
||||
)
|
||||
|
||||
type (
|
||||
optionFunc[C any] func(*C)
|
||||
otelOptionFunc func(*otelConfig)
|
||||
)
|
||||
|
||||
type otelConfig struct {
|
||||
TracerProvider trace.TracerProvider
|
||||
Tracer trace.Tracer
|
||||
MeterProvider metric.MeterProvider
|
||||
Meter metric.Meter
|
||||
Attributes []attribute.KeyValue
|
||||
}
|
||||
|
||||
func (cfg *otelConfig) initOTEL() {
|
||||
if cfg.TracerProvider == nil {
|
||||
cfg.TracerProvider = otel.GetTracerProvider()
|
||||
}
|
||||
if cfg.MeterProvider == nil {
|
||||
cfg.MeterProvider = otel.GetMeterProvider()
|
||||
}
|
||||
cfg.Tracer = cfg.TracerProvider.Tracer(otelogen.Name,
|
||||
trace.WithInstrumentationVersion(otelogen.SemVersion()),
|
||||
)
|
||||
cfg.Meter = cfg.MeterProvider.Meter(otelogen.Name,
|
||||
metric.WithInstrumentationVersion(otelogen.SemVersion()),
|
||||
)
|
||||
}
|
||||
|
||||
// ErrorHandler is error handler.
|
||||
type ErrorHandler = ogenerrors.ErrorHandler
|
||||
|
||||
type serverConfig struct {
|
||||
otelConfig
|
||||
NotFound http.HandlerFunc
|
||||
MethodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)
|
||||
ErrorHandler ErrorHandler
|
||||
Prefix string
|
||||
Middleware Middleware
|
||||
MaxMultipartMemory int64
|
||||
}
|
||||
|
||||
// ServerOption is server config option.
|
||||
type ServerOption interface {
|
||||
applyServer(*serverConfig)
|
||||
}
|
||||
|
||||
var _ ServerOption = (optionFunc[serverConfig])(nil)
|
||||
|
||||
func (o optionFunc[C]) applyServer(c *C) {
|
||||
o(c)
|
||||
}
|
||||
|
||||
var _ ServerOption = (otelOptionFunc)(nil)
|
||||
|
||||
func (o otelOptionFunc) applyServer(c *serverConfig) {
|
||||
o(&c.otelConfig)
|
||||
}
|
||||
|
||||
func newServerConfig(opts ...ServerOption) serverConfig {
|
||||
cfg := serverConfig{
|
||||
NotFound: http.NotFound,
|
||||
MethodNotAllowed: nil,
|
||||
ErrorHandler: ogenerrors.DefaultErrorHandler,
|
||||
Middleware: nil,
|
||||
MaxMultipartMemory: 32 << 20, // 32 MB
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt.applyServer(&cfg)
|
||||
}
|
||||
cfg.initOTEL()
|
||||
return cfg
|
||||
}
|
||||
|
||||
type baseServer struct {
|
||||
cfg serverConfig
|
||||
requests metric.Int64Counter
|
||||
errors metric.Int64Counter
|
||||
duration metric.Float64Histogram
|
||||
}
|
||||
|
||||
func (s baseServer) notFound(w http.ResponseWriter, r *http.Request) {
|
||||
s.cfg.NotFound(w, r)
|
||||
}
|
||||
|
||||
type notAllowedParams struct {
|
||||
allowedMethods string
|
||||
allowedHeaders map[string]string
|
||||
acceptPost string
|
||||
acceptPatch string
|
||||
}
|
||||
|
||||
func (s baseServer) notAllowed(w http.ResponseWriter, r *http.Request, params notAllowedParams) {
|
||||
h := w.Header()
|
||||
isOptions := r.Method == "OPTIONS"
|
||||
if isOptions {
|
||||
h.Set("Access-Control-Allow-Methods", params.allowedMethods)
|
||||
if params.allowedHeaders != nil {
|
||||
m := r.Header.Get("Access-Control-Request-Method")
|
||||
if m != "" {
|
||||
allowedHeaders, ok := params.allowedHeaders[strings.ToUpper(m)]
|
||||
if ok {
|
||||
h.Set("Access-Control-Allow-Headers", allowedHeaders)
|
||||
}
|
||||
}
|
||||
}
|
||||
if params.acceptPost != "" {
|
||||
h.Set("Accept-Post", params.acceptPost)
|
||||
}
|
||||
if params.acceptPatch != "" {
|
||||
h.Set("Accept-Patch", params.acceptPatch)
|
||||
}
|
||||
}
|
||||
if s.cfg.MethodNotAllowed != nil {
|
||||
s.cfg.MethodNotAllowed(w, r, params.allowedMethods)
|
||||
return
|
||||
}
|
||||
status := http.StatusNoContent
|
||||
if !isOptions {
|
||||
h.Set("Allow", params.allowedMethods)
|
||||
status = http.StatusMethodNotAllowed
|
||||
}
|
||||
w.WriteHeader(status)
|
||||
}
|
||||
|
||||
func (cfg serverConfig) baseServer() (s baseServer, err error) {
|
||||
s = baseServer{cfg: cfg}
|
||||
if s.requests, err = otelogen.ServerRequestCountCounter(s.cfg.Meter); err != nil {
|
||||
return s, err
|
||||
}
|
||||
if s.errors, err = otelogen.ServerErrorsCountCounter(s.cfg.Meter); err != nil {
|
||||
return s, err
|
||||
}
|
||||
if s.duration, err = otelogen.ServerDurationHistogram(s.cfg.Meter); err != nil {
|
||||
return s, err
|
||||
}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type clientConfig struct {
|
||||
otelConfig
|
||||
Client ht.Client
|
||||
}
|
||||
|
||||
// ClientOption is client config option.
|
||||
type ClientOption interface {
|
||||
applyClient(*clientConfig)
|
||||
}
|
||||
|
||||
var _ ClientOption = (optionFunc[clientConfig])(nil)
|
||||
|
||||
func (o optionFunc[C]) applyClient(c *C) {
|
||||
o(c)
|
||||
}
|
||||
|
||||
var _ ClientOption = (otelOptionFunc)(nil)
|
||||
|
||||
func (o otelOptionFunc) applyClient(c *clientConfig) {
|
||||
o(&c.otelConfig)
|
||||
}
|
||||
|
||||
func newClientConfig(opts ...ClientOption) clientConfig {
|
||||
cfg := clientConfig{
|
||||
Client: http.DefaultClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt.applyClient(&cfg)
|
||||
}
|
||||
cfg.initOTEL()
|
||||
return cfg
|
||||
}
|
||||
|
||||
type baseClient struct {
|
||||
cfg clientConfig
|
||||
requests metric.Int64Counter
|
||||
errors metric.Int64Counter
|
||||
duration metric.Float64Histogram
|
||||
}
|
||||
|
||||
func (cfg clientConfig) baseClient() (c baseClient, err error) {
|
||||
c = baseClient{cfg: cfg}
|
||||
if c.requests, err = otelogen.ClientRequestCountCounter(c.cfg.Meter); err != nil {
|
||||
return c, err
|
||||
}
|
||||
if c.errors, err = otelogen.ClientErrorsCountCounter(c.cfg.Meter); err != nil {
|
||||
return c, err
|
||||
}
|
||||
if c.duration, err = otelogen.ClientDurationHistogram(c.cfg.Meter); err != nil {
|
||||
return c, err
|
||||
}
|
||||
return c, nil
|
||||
}
|
||||
|
||||
// Option is config option.
|
||||
type Option interface {
|
||||
ServerOption
|
||||
ClientOption
|
||||
}
|
||||
|
||||
// WithTracerProvider specifies a tracer provider to use for creating a tracer.
|
||||
//
|
||||
// If none is specified, the global provider is used.
|
||||
func WithTracerProvider(provider trace.TracerProvider) Option {
|
||||
return otelOptionFunc(func(cfg *otelConfig) {
|
||||
if provider != nil {
|
||||
cfg.TracerProvider = provider
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// WithMeterProvider specifies a meter provider to use for creating a meter.
|
||||
//
|
||||
// If none is specified, the otel.GetMeterProvider() is used.
|
||||
func WithMeterProvider(provider metric.MeterProvider) Option {
|
||||
return otelOptionFunc(func(cfg *otelConfig) {
|
||||
if provider != nil {
|
||||
cfg.MeterProvider = provider
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// WithAttributes specifies default otel attributes.
|
||||
func WithAttributes(attributes ...attribute.KeyValue) Option {
|
||||
return otelOptionFunc(func(cfg *otelConfig) {
|
||||
cfg.Attributes = attributes
|
||||
})
|
||||
}
|
||||
|
||||
// WithClient specifies http client to use.
|
||||
func WithClient(client ht.Client) ClientOption {
|
||||
return optionFunc[clientConfig](func(cfg *clientConfig) {
|
||||
if client != nil {
|
||||
cfg.Client = client
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// WithNotFound specifies Not Found handler to use.
|
||||
func WithNotFound(notFound http.HandlerFunc) ServerOption {
|
||||
return optionFunc[serverConfig](func(cfg *serverConfig) {
|
||||
if notFound != nil {
|
||||
cfg.NotFound = notFound
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// WithMethodNotAllowed specifies Method Not Allowed handler to use.
|
||||
func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption {
|
||||
return optionFunc[serverConfig](func(cfg *serverConfig) {
|
||||
if methodNotAllowed != nil {
|
||||
cfg.MethodNotAllowed = methodNotAllowed
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// WithErrorHandler specifies error handler to use.
|
||||
func WithErrorHandler(h ErrorHandler) ServerOption {
|
||||
return optionFunc[serverConfig](func(cfg *serverConfig) {
|
||||
if h != nil {
|
||||
cfg.ErrorHandler = h
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// WithPathPrefix specifies server path prefix.
|
||||
func WithPathPrefix(prefix string) ServerOption {
|
||||
return optionFunc[serverConfig](func(cfg *serverConfig) {
|
||||
cfg.Prefix = prefix
|
||||
})
|
||||
}
|
||||
|
||||
// WithMiddleware specifies middlewares to use.
|
||||
func WithMiddleware(m ...Middleware) ServerOption {
|
||||
return optionFunc[serverConfig](func(cfg *serverConfig) {
|
||||
switch len(m) {
|
||||
case 0:
|
||||
cfg.Middleware = nil
|
||||
case 1:
|
||||
cfg.Middleware = m[0]
|
||||
default:
|
||||
cfg.Middleware = middleware.ChainMiddlewares(m...)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// WithMaxMultipartMemory specifies limit of memory for storing file parts.
|
||||
// File parts which can't be stored in memory will be stored on disk in temporary files.
|
||||
func WithMaxMultipartMemory(max int64) ServerOption {
|
||||
return optionFunc[serverConfig](func(cfg *serverConfig) {
|
||||
if max > 0 {
|
||||
cfg.MaxMultipartMemory = max
|
||||
}
|
||||
})
|
||||
}
|
||||
5049
internal/service/yookassa/gen/oas_client_gen.go
Normal file
5049
internal/service/yookassa/gen/oas_client_gen.go
Normal file
File diff suppressed because it is too large
Load Diff
47
internal/service/yookassa/gen/oas_defaults_gen.go
Normal file
47
internal/service/yookassa/gen/oas_defaults_gen.go
Normal file
@@ -0,0 +1,47 @@
|
||||
// Code generated by ogen, DO NOT EDIT.
|
||||
|
||||
package gen
|
||||
|
||||
// setDefaults set default value of fields.
|
||||
func (s *ConfirmationDataRedirect) setDefaults() {
|
||||
{
|
||||
val := bool(false)
|
||||
s.Enforce.SetTo(Enforce(val))
|
||||
}
|
||||
}
|
||||
|
||||
// setDefaults set default value of fields.
|
||||
func (s *ConfirmationRedirect) setDefaults() {
|
||||
{
|
||||
val := bool(false)
|
||||
s.Enforce.SetTo(Enforce(val))
|
||||
}
|
||||
}
|
||||
|
||||
// setDefaults set default value of fields.
|
||||
func (s *PaymentsPostReq) setDefaults() {
|
||||
{
|
||||
val := bool(false)
|
||||
s.SavePaymentMethod.SetTo(SavePaymentMethodAttribute(val))
|
||||
}
|
||||
{
|
||||
val := bool(false)
|
||||
s.Capture.SetTo(Capture(val))
|
||||
}
|
||||
}
|
||||
|
||||
// setDefaults set default value of fields.
|
||||
func (s *SafeDeal) setDefaults() {
|
||||
{
|
||||
val := FeeMoment("payment_succeeded")
|
||||
s.FeeMoment = val
|
||||
}
|
||||
}
|
||||
|
||||
// setDefaults set default value of fields.
|
||||
func (s *SafeDealRequest) setDefaults() {
|
||||
{
|
||||
val := FeeMoment("payment_succeeded")
|
||||
s.FeeMoment = val
|
||||
}
|
||||
}
|
||||
5980
internal/service/yookassa/gen/oas_handlers_gen.go
Normal file
5980
internal/service/yookassa/gen/oas_handlers_gen.go
Normal file
File diff suppressed because it is too large
Load Diff
110
internal/service/yookassa/gen/oas_interfaces_gen.go
Normal file
110
internal/service/yookassa/gen/oas_interfaces_gen.go
Normal file
@@ -0,0 +1,110 @@
|
||||
// Code generated by ogen, DO NOT EDIT.
|
||||
package gen
|
||||
|
||||
type DealsDealIDGetRes interface {
|
||||
dealsDealIDGetRes()
|
||||
}
|
||||
|
||||
type DealsGetRes interface {
|
||||
dealsGetRes()
|
||||
}
|
||||
|
||||
type DealsPostRes interface {
|
||||
dealsPostRes()
|
||||
}
|
||||
|
||||
type MeGetRes interface {
|
||||
meGetRes()
|
||||
}
|
||||
|
||||
type PaymentMethodsPaymentMethodIDGetRes interface {
|
||||
paymentMethodsPaymentMethodIDGetRes()
|
||||
}
|
||||
|
||||
type PaymentMethodsPostRes interface {
|
||||
paymentMethodsPostRes()
|
||||
}
|
||||
|
||||
type PaymentsGetRes interface {
|
||||
paymentsGetRes()
|
||||
}
|
||||
|
||||
type PaymentsPaymentIDCancelPostRes interface {
|
||||
paymentsPaymentIDCancelPostRes()
|
||||
}
|
||||
|
||||
type PaymentsPaymentIDCapturePostRes interface {
|
||||
paymentsPaymentIDCapturePostRes()
|
||||
}
|
||||
|
||||
type PaymentsPaymentIDGetRes interface {
|
||||
paymentsPaymentIDGetRes()
|
||||
}
|
||||
|
||||
type PaymentsPostRes interface {
|
||||
paymentsPostRes()
|
||||
}
|
||||
|
||||
type PayoutsGetRes interface {
|
||||
payoutsGetRes()
|
||||
}
|
||||
|
||||
type PayoutsPayoutIDGetRes interface {
|
||||
payoutsPayoutIDGetRes()
|
||||
}
|
||||
|
||||
type PayoutsPostRes interface {
|
||||
payoutsPostRes()
|
||||
}
|
||||
|
||||
type PayoutsSearchGetRes interface {
|
||||
payoutsSearchGetRes()
|
||||
}
|
||||
|
||||
type PersonalDataPersonalDataIDGetRes interface {
|
||||
personalDataPersonalDataIDGetRes()
|
||||
}
|
||||
|
||||
type PersonalDataPostRes interface {
|
||||
personalDataPostRes()
|
||||
}
|
||||
|
||||
type ReceiptsGetRes interface {
|
||||
receiptsGetRes()
|
||||
}
|
||||
|
||||
type ReceiptsPostRes interface {
|
||||
receiptsPostRes()
|
||||
}
|
||||
|
||||
type ReceiptsReceiptIDGetRes interface {
|
||||
receiptsReceiptIDGetRes()
|
||||
}
|
||||
|
||||
type RefundsGetRes interface {
|
||||
refundsGetRes()
|
||||
}
|
||||
|
||||
type RefundsPostRes interface {
|
||||
refundsPostRes()
|
||||
}
|
||||
|
||||
type RefundsRefundIDGetRes interface {
|
||||
refundsRefundIDGetRes()
|
||||
}
|
||||
|
||||
type SbpBanksGetRes interface {
|
||||
sbpBanksGetRes()
|
||||
}
|
||||
|
||||
type WebhooksGetRes interface {
|
||||
webhooksGetRes()
|
||||
}
|
||||
|
||||
type WebhooksPostRes interface {
|
||||
webhooksPostRes()
|
||||
}
|
||||
|
||||
type WebhooksWebhookIDDeleteRes interface {
|
||||
webhooksWebhookIDDeleteRes()
|
||||
}
|
||||
41990
internal/service/yookassa/gen/oas_json_gen.go
Normal file
41990
internal/service/yookassa/gen/oas_json_gen.go
Normal file
File diff suppressed because it is too large
Load Diff
42
internal/service/yookassa/gen/oas_labeler_gen.go
Normal file
42
internal/service/yookassa/gen/oas_labeler_gen.go
Normal file
@@ -0,0 +1,42 @@
|
||||
// Code generated by ogen, DO NOT EDIT.
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
)
|
||||
|
||||
// Labeler is used to allow adding custom attributes to the server request metrics.
|
||||
type Labeler struct {
|
||||
attrs []attribute.KeyValue
|
||||
}
|
||||
|
||||
// Add attributes to the Labeler.
|
||||
func (l *Labeler) Add(attrs ...attribute.KeyValue) {
|
||||
l.attrs = append(l.attrs, attrs...)
|
||||
}
|
||||
|
||||
// AttributeSet returns the attributes added to the Labeler as an attribute.Set.
|
||||
func (l *Labeler) AttributeSet() attribute.Set {
|
||||
return attribute.NewSet(l.attrs...)
|
||||
}
|
||||
|
||||
type labelerContextKey struct{}
|
||||
|
||||
// LabelerFromContext retrieves the Labeler from the provided context, if present.
|
||||
//
|
||||
// If no Labeler was found in the provided context a new, empty Labeler is returned and the second
|
||||
// return value is false. In this case it is safe to use the Labeler but any attributes added to
|
||||
// it will not be used.
|
||||
func LabelerFromContext(ctx context.Context) (*Labeler, bool) {
|
||||
if l, ok := ctx.Value(labelerContextKey{}).(*Labeler); ok {
|
||||
return l, true
|
||||
}
|
||||
return &Labeler{}, false
|
||||
}
|
||||
|
||||
func contextWithLabeler(ctx context.Context, l *Labeler) context.Context {
|
||||
return context.WithValue(ctx, labelerContextKey{}, l)
|
||||
}
|
||||
10
internal/service/yookassa/gen/oas_middleware_gen.go
Normal file
10
internal/service/yookassa/gen/oas_middleware_gen.go
Normal file
@@ -0,0 +1,10 @@
|
||||
// Code generated by ogen, DO NOT EDIT.
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
"github.com/ogen-go/ogen/middleware"
|
||||
)
|
||||
|
||||
// Middleware is middleware type.
|
||||
type Middleware = middleware.Middleware
|
||||
36
internal/service/yookassa/gen/oas_operations_gen.go
Normal file
36
internal/service/yookassa/gen/oas_operations_gen.go
Normal file
@@ -0,0 +1,36 @@
|
||||
// Code generated by ogen, DO NOT EDIT.
|
||||
|
||||
package gen
|
||||
|
||||
// OperationName is the ogen operation name
|
||||
type OperationName = string
|
||||
|
||||
const (
|
||||
DealsDealIDGetOperation OperationName = "DealsDealIDGet"
|
||||
DealsGetOperation OperationName = "DealsGet"
|
||||
DealsPostOperation OperationName = "DealsPost"
|
||||
MeGetOperation OperationName = "MeGet"
|
||||
PaymentMethodsPaymentMethodIDGetOperation OperationName = "PaymentMethodsPaymentMethodIDGet"
|
||||
PaymentMethodsPostOperation OperationName = "PaymentMethodsPost"
|
||||
PaymentsGetOperation OperationName = "PaymentsGet"
|
||||
PaymentsPaymentIDCancelPostOperation OperationName = "PaymentsPaymentIDCancelPost"
|
||||
PaymentsPaymentIDCapturePostOperation OperationName = "PaymentsPaymentIDCapturePost"
|
||||
PaymentsPaymentIDGetOperation OperationName = "PaymentsPaymentIDGet"
|
||||
PaymentsPostOperation OperationName = "PaymentsPost"
|
||||
PayoutsGetOperation OperationName = "PayoutsGet"
|
||||
PayoutsPayoutIDGetOperation OperationName = "PayoutsPayoutIDGet"
|
||||
PayoutsPostOperation OperationName = "PayoutsPost"
|
||||
PayoutsSearchGetOperation OperationName = "PayoutsSearchGet"
|
||||
PersonalDataPersonalDataIDGetOperation OperationName = "PersonalDataPersonalDataIDGet"
|
||||
PersonalDataPostOperation OperationName = "PersonalDataPost"
|
||||
ReceiptsGetOperation OperationName = "ReceiptsGet"
|
||||
ReceiptsPostOperation OperationName = "ReceiptsPost"
|
||||
ReceiptsReceiptIDGetOperation OperationName = "ReceiptsReceiptIDGet"
|
||||
RefundsGetOperation OperationName = "RefundsGet"
|
||||
RefundsPostOperation OperationName = "RefundsPost"
|
||||
RefundsRefundIDGetOperation OperationName = "RefundsRefundIDGet"
|
||||
SbpBanksGetOperation OperationName = "SbpBanksGet"
|
||||
WebhooksGetOperation OperationName = "WebhooksGet"
|
||||
WebhooksPostOperation OperationName = "WebhooksPost"
|
||||
WebhooksWebhookIDDeleteOperation OperationName = "WebhooksWebhookIDDelete"
|
||||
)
|
||||
5237
internal/service/yookassa/gen/oas_parameters_gen.go
Normal file
5237
internal/service/yookassa/gen/oas_parameters_gen.go
Normal file
File diff suppressed because it is too large
Load Diff
718
internal/service/yookassa/gen/oas_request_decoders_gen.go
Normal file
718
internal/service/yookassa/gen/oas_request_decoders_gen.go
Normal file
@@ -0,0 +1,718 @@
|
||||
// Code generated by ogen, DO NOT EDIT.
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"mime"
|
||||
"net/http"
|
||||
|
||||
"github.com/go-faster/errors"
|
||||
"github.com/go-faster/jx"
|
||||
"github.com/ogen-go/ogen/ogenerrors"
|
||||
"github.com/ogen-go/ogen/validate"
|
||||
)
|
||||
|
||||
func (s *Server) decodeDealsPostRequest(r *http.Request) (
|
||||
req *SafeDealRequest,
|
||||
rawBody []byte,
|
||||
close func() error,
|
||||
rerr error,
|
||||
) {
|
||||
var closers []func() error
|
||||
close = func() error {
|
||||
var merr error
|
||||
// Close in reverse order, to match defer behavior.
|
||||
for i := len(closers) - 1; i >= 0; i-- {
|
||||
c := closers[i]
|
||||
merr = errors.Join(merr, c())
|
||||
}
|
||||
return merr
|
||||
}
|
||||
defer func() {
|
||||
if rerr != nil {
|
||||
rerr = errors.Join(rerr, close())
|
||||
}
|
||||
}()
|
||||
ct, _, err := mime.ParseMediaType(r.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
return req, rawBody, close, errors.Wrap(err, "parse media type")
|
||||
}
|
||||
switch {
|
||||
case ct == "application/json":
|
||||
if r.ContentLength == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
buf, err := io.ReadAll(r.Body)
|
||||
defer func() {
|
||||
_ = r.Body.Close()
|
||||
}()
|
||||
if err != nil {
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
|
||||
// Reset the body to allow for downstream reading.
|
||||
r.Body = io.NopCloser(bytes.NewBuffer(buf))
|
||||
|
||||
if len(buf) == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
|
||||
rawBody = append(rawBody, buf...)
|
||||
d := jx.DecodeBytes(buf)
|
||||
|
||||
var request SafeDealRequest
|
||||
if err := func() error {
|
||||
if err := request.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := d.Skip(); err != io.EOF {
|
||||
return errors.New("unexpected trailing data")
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
err = &ogenerrors.DecodeBodyError{
|
||||
ContentType: ct,
|
||||
Body: buf,
|
||||
Err: err,
|
||||
}
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
if err := func() error {
|
||||
if err := request.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return req, rawBody, close, errors.Wrap(err, "validate")
|
||||
}
|
||||
return &request, rawBody, close, nil
|
||||
default:
|
||||
return req, rawBody, close, validate.InvalidContentType(ct)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) decodePaymentMethodsPostRequest(r *http.Request) (
|
||||
req PaymentMethodsPostReq,
|
||||
rawBody []byte,
|
||||
close func() error,
|
||||
rerr error,
|
||||
) {
|
||||
var closers []func() error
|
||||
close = func() error {
|
||||
var merr error
|
||||
// Close in reverse order, to match defer behavior.
|
||||
for i := len(closers) - 1; i >= 0; i-- {
|
||||
c := closers[i]
|
||||
merr = errors.Join(merr, c())
|
||||
}
|
||||
return merr
|
||||
}
|
||||
defer func() {
|
||||
if rerr != nil {
|
||||
rerr = errors.Join(rerr, close())
|
||||
}
|
||||
}()
|
||||
ct, _, err := mime.ParseMediaType(r.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
return req, rawBody, close, errors.Wrap(err, "parse media type")
|
||||
}
|
||||
switch {
|
||||
case ct == "application/json":
|
||||
if r.ContentLength == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
buf, err := io.ReadAll(r.Body)
|
||||
defer func() {
|
||||
_ = r.Body.Close()
|
||||
}()
|
||||
if err != nil {
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
|
||||
// Reset the body to allow for downstream reading.
|
||||
r.Body = io.NopCloser(bytes.NewBuffer(buf))
|
||||
|
||||
if len(buf) == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
|
||||
rawBody = append(rawBody, buf...)
|
||||
d := jx.DecodeBytes(buf)
|
||||
|
||||
var request PaymentMethodsPostReq
|
||||
if err := func() error {
|
||||
if err := request.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := d.Skip(); err != io.EOF {
|
||||
return errors.New("unexpected trailing data")
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
err = &ogenerrors.DecodeBodyError{
|
||||
ContentType: ct,
|
||||
Body: buf,
|
||||
Err: err,
|
||||
}
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
if err := func() error {
|
||||
if err := request.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return req, rawBody, close, errors.Wrap(err, "validate")
|
||||
}
|
||||
return request, rawBody, close, nil
|
||||
default:
|
||||
return req, rawBody, close, validate.InvalidContentType(ct)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) decodePaymentsPaymentIDCapturePostRequest(r *http.Request) (
|
||||
req *PaymentsPaymentIDCapturePostReq,
|
||||
rawBody []byte,
|
||||
close func() error,
|
||||
rerr error,
|
||||
) {
|
||||
var closers []func() error
|
||||
close = func() error {
|
||||
var merr error
|
||||
// Close in reverse order, to match defer behavior.
|
||||
for i := len(closers) - 1; i >= 0; i-- {
|
||||
c := closers[i]
|
||||
merr = errors.Join(merr, c())
|
||||
}
|
||||
return merr
|
||||
}
|
||||
defer func() {
|
||||
if rerr != nil {
|
||||
rerr = errors.Join(rerr, close())
|
||||
}
|
||||
}()
|
||||
ct, _, err := mime.ParseMediaType(r.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
return req, rawBody, close, errors.Wrap(err, "parse media type")
|
||||
}
|
||||
switch {
|
||||
case ct == "application/json":
|
||||
if r.ContentLength == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
buf, err := io.ReadAll(r.Body)
|
||||
defer func() {
|
||||
_ = r.Body.Close()
|
||||
}()
|
||||
if err != nil {
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
|
||||
// Reset the body to allow for downstream reading.
|
||||
r.Body = io.NopCloser(bytes.NewBuffer(buf))
|
||||
|
||||
if len(buf) == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
|
||||
rawBody = append(rawBody, buf...)
|
||||
d := jx.DecodeBytes(buf)
|
||||
|
||||
var request PaymentsPaymentIDCapturePostReq
|
||||
if err := func() error {
|
||||
if err := request.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := d.Skip(); err != io.EOF {
|
||||
return errors.New("unexpected trailing data")
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
err = &ogenerrors.DecodeBodyError{
|
||||
ContentType: ct,
|
||||
Body: buf,
|
||||
Err: err,
|
||||
}
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
if err := func() error {
|
||||
if err := request.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return req, rawBody, close, errors.Wrap(err, "validate")
|
||||
}
|
||||
return &request, rawBody, close, nil
|
||||
default:
|
||||
return req, rawBody, close, validate.InvalidContentType(ct)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) decodePaymentsPostRequest(r *http.Request) (
|
||||
req *PaymentsPostReq,
|
||||
rawBody []byte,
|
||||
close func() error,
|
||||
rerr error,
|
||||
) {
|
||||
var closers []func() error
|
||||
close = func() error {
|
||||
var merr error
|
||||
// Close in reverse order, to match defer behavior.
|
||||
for i := len(closers) - 1; i >= 0; i-- {
|
||||
c := closers[i]
|
||||
merr = errors.Join(merr, c())
|
||||
}
|
||||
return merr
|
||||
}
|
||||
defer func() {
|
||||
if rerr != nil {
|
||||
rerr = errors.Join(rerr, close())
|
||||
}
|
||||
}()
|
||||
ct, _, err := mime.ParseMediaType(r.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
return req, rawBody, close, errors.Wrap(err, "parse media type")
|
||||
}
|
||||
switch {
|
||||
case ct == "application/json":
|
||||
if r.ContentLength == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
buf, err := io.ReadAll(r.Body)
|
||||
defer func() {
|
||||
_ = r.Body.Close()
|
||||
}()
|
||||
if err != nil {
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
|
||||
// Reset the body to allow for downstream reading.
|
||||
r.Body = io.NopCloser(bytes.NewBuffer(buf))
|
||||
|
||||
if len(buf) == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
|
||||
rawBody = append(rawBody, buf...)
|
||||
d := jx.DecodeBytes(buf)
|
||||
|
||||
var request PaymentsPostReq
|
||||
if err := func() error {
|
||||
if err := request.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := d.Skip(); err != io.EOF {
|
||||
return errors.New("unexpected trailing data")
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
err = &ogenerrors.DecodeBodyError{
|
||||
ContentType: ct,
|
||||
Body: buf,
|
||||
Err: err,
|
||||
}
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
if err := func() error {
|
||||
if err := request.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return req, rawBody, close, errors.Wrap(err, "validate")
|
||||
}
|
||||
return &request, rawBody, close, nil
|
||||
default:
|
||||
return req, rawBody, close, validate.InvalidContentType(ct)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) decodePayoutsPostRequest(r *http.Request) (
|
||||
req *PayoutRequest,
|
||||
rawBody []byte,
|
||||
close func() error,
|
||||
rerr error,
|
||||
) {
|
||||
var closers []func() error
|
||||
close = func() error {
|
||||
var merr error
|
||||
// Close in reverse order, to match defer behavior.
|
||||
for i := len(closers) - 1; i >= 0; i-- {
|
||||
c := closers[i]
|
||||
merr = errors.Join(merr, c())
|
||||
}
|
||||
return merr
|
||||
}
|
||||
defer func() {
|
||||
if rerr != nil {
|
||||
rerr = errors.Join(rerr, close())
|
||||
}
|
||||
}()
|
||||
ct, _, err := mime.ParseMediaType(r.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
return req, rawBody, close, errors.Wrap(err, "parse media type")
|
||||
}
|
||||
switch {
|
||||
case ct == "application/json":
|
||||
if r.ContentLength == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
buf, err := io.ReadAll(r.Body)
|
||||
defer func() {
|
||||
_ = r.Body.Close()
|
||||
}()
|
||||
if err != nil {
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
|
||||
// Reset the body to allow for downstream reading.
|
||||
r.Body = io.NopCloser(bytes.NewBuffer(buf))
|
||||
|
||||
if len(buf) == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
|
||||
rawBody = append(rawBody, buf...)
|
||||
d := jx.DecodeBytes(buf)
|
||||
|
||||
var request PayoutRequest
|
||||
if err := func() error {
|
||||
if err := request.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := d.Skip(); err != io.EOF {
|
||||
return errors.New("unexpected trailing data")
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
err = &ogenerrors.DecodeBodyError{
|
||||
ContentType: ct,
|
||||
Body: buf,
|
||||
Err: err,
|
||||
}
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
if err := func() error {
|
||||
if err := request.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return req, rawBody, close, errors.Wrap(err, "validate")
|
||||
}
|
||||
return &request, rawBody, close, nil
|
||||
default:
|
||||
return req, rawBody, close, validate.InvalidContentType(ct)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) decodePersonalDataPostRequest(r *http.Request) (
|
||||
req PersonalDataPostReq,
|
||||
rawBody []byte,
|
||||
close func() error,
|
||||
rerr error,
|
||||
) {
|
||||
var closers []func() error
|
||||
close = func() error {
|
||||
var merr error
|
||||
// Close in reverse order, to match defer behavior.
|
||||
for i := len(closers) - 1; i >= 0; i-- {
|
||||
c := closers[i]
|
||||
merr = errors.Join(merr, c())
|
||||
}
|
||||
return merr
|
||||
}
|
||||
defer func() {
|
||||
if rerr != nil {
|
||||
rerr = errors.Join(rerr, close())
|
||||
}
|
||||
}()
|
||||
ct, _, err := mime.ParseMediaType(r.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
return req, rawBody, close, errors.Wrap(err, "parse media type")
|
||||
}
|
||||
switch {
|
||||
case ct == "application/json":
|
||||
if r.ContentLength == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
buf, err := io.ReadAll(r.Body)
|
||||
defer func() {
|
||||
_ = r.Body.Close()
|
||||
}()
|
||||
if err != nil {
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
|
||||
// Reset the body to allow for downstream reading.
|
||||
r.Body = io.NopCloser(bytes.NewBuffer(buf))
|
||||
|
||||
if len(buf) == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
|
||||
rawBody = append(rawBody, buf...)
|
||||
d := jx.DecodeBytes(buf)
|
||||
|
||||
var request PersonalDataPostReq
|
||||
if err := func() error {
|
||||
if err := request.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := d.Skip(); err != io.EOF {
|
||||
return errors.New("unexpected trailing data")
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
err = &ogenerrors.DecodeBodyError{
|
||||
ContentType: ct,
|
||||
Body: buf,
|
||||
Err: err,
|
||||
}
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
if err := func() error {
|
||||
if err := request.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return req, rawBody, close, errors.Wrap(err, "validate")
|
||||
}
|
||||
return request, rawBody, close, nil
|
||||
default:
|
||||
return req, rawBody, close, validate.InvalidContentType(ct)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) decodeReceiptsPostRequest(r *http.Request) (
|
||||
req PostReceiptData,
|
||||
rawBody []byte,
|
||||
close func() error,
|
||||
rerr error,
|
||||
) {
|
||||
var closers []func() error
|
||||
close = func() error {
|
||||
var merr error
|
||||
// Close in reverse order, to match defer behavior.
|
||||
for i := len(closers) - 1; i >= 0; i-- {
|
||||
c := closers[i]
|
||||
merr = errors.Join(merr, c())
|
||||
}
|
||||
return merr
|
||||
}
|
||||
defer func() {
|
||||
if rerr != nil {
|
||||
rerr = errors.Join(rerr, close())
|
||||
}
|
||||
}()
|
||||
ct, _, err := mime.ParseMediaType(r.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
return req, rawBody, close, errors.Wrap(err, "parse media type")
|
||||
}
|
||||
switch {
|
||||
case ct == "application/json":
|
||||
if r.ContentLength == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
buf, err := io.ReadAll(r.Body)
|
||||
defer func() {
|
||||
_ = r.Body.Close()
|
||||
}()
|
||||
if err != nil {
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
|
||||
// Reset the body to allow for downstream reading.
|
||||
r.Body = io.NopCloser(bytes.NewBuffer(buf))
|
||||
|
||||
if len(buf) == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
|
||||
rawBody = append(rawBody, buf...)
|
||||
d := jx.DecodeBytes(buf)
|
||||
|
||||
var request PostReceiptData
|
||||
if err := func() error {
|
||||
if err := request.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := d.Skip(); err != io.EOF {
|
||||
return errors.New("unexpected trailing data")
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
err = &ogenerrors.DecodeBodyError{
|
||||
ContentType: ct,
|
||||
Body: buf,
|
||||
Err: err,
|
||||
}
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
return request, rawBody, close, nil
|
||||
default:
|
||||
return req, rawBody, close, validate.InvalidContentType(ct)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) decodeRefundsPostRequest(r *http.Request) (
|
||||
req *RefundsPostReq,
|
||||
rawBody []byte,
|
||||
close func() error,
|
||||
rerr error,
|
||||
) {
|
||||
var closers []func() error
|
||||
close = func() error {
|
||||
var merr error
|
||||
// Close in reverse order, to match defer behavior.
|
||||
for i := len(closers) - 1; i >= 0; i-- {
|
||||
c := closers[i]
|
||||
merr = errors.Join(merr, c())
|
||||
}
|
||||
return merr
|
||||
}
|
||||
defer func() {
|
||||
if rerr != nil {
|
||||
rerr = errors.Join(rerr, close())
|
||||
}
|
||||
}()
|
||||
ct, _, err := mime.ParseMediaType(r.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
return req, rawBody, close, errors.Wrap(err, "parse media type")
|
||||
}
|
||||
switch {
|
||||
case ct == "application/json":
|
||||
if r.ContentLength == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
buf, err := io.ReadAll(r.Body)
|
||||
defer func() {
|
||||
_ = r.Body.Close()
|
||||
}()
|
||||
if err != nil {
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
|
||||
// Reset the body to allow for downstream reading.
|
||||
r.Body = io.NopCloser(bytes.NewBuffer(buf))
|
||||
|
||||
if len(buf) == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
|
||||
rawBody = append(rawBody, buf...)
|
||||
d := jx.DecodeBytes(buf)
|
||||
|
||||
var request RefundsPostReq
|
||||
if err := func() error {
|
||||
if err := request.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := d.Skip(); err != io.EOF {
|
||||
return errors.New("unexpected trailing data")
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
err = &ogenerrors.DecodeBodyError{
|
||||
ContentType: ct,
|
||||
Body: buf,
|
||||
Err: err,
|
||||
}
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
if err := func() error {
|
||||
if err := request.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return req, rawBody, close, errors.Wrap(err, "validate")
|
||||
}
|
||||
return &request, rawBody, close, nil
|
||||
default:
|
||||
return req, rawBody, close, validate.InvalidContentType(ct)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) decodeWebhooksPostRequest(r *http.Request) (
|
||||
req *WebhooksPostReq,
|
||||
rawBody []byte,
|
||||
close func() error,
|
||||
rerr error,
|
||||
) {
|
||||
var closers []func() error
|
||||
close = func() error {
|
||||
var merr error
|
||||
// Close in reverse order, to match defer behavior.
|
||||
for i := len(closers) - 1; i >= 0; i-- {
|
||||
c := closers[i]
|
||||
merr = errors.Join(merr, c())
|
||||
}
|
||||
return merr
|
||||
}
|
||||
defer func() {
|
||||
if rerr != nil {
|
||||
rerr = errors.Join(rerr, close())
|
||||
}
|
||||
}()
|
||||
ct, _, err := mime.ParseMediaType(r.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
return req, rawBody, close, errors.Wrap(err, "parse media type")
|
||||
}
|
||||
switch {
|
||||
case ct == "application/json":
|
||||
if r.ContentLength == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
buf, err := io.ReadAll(r.Body)
|
||||
defer func() {
|
||||
_ = r.Body.Close()
|
||||
}()
|
||||
if err != nil {
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
|
||||
// Reset the body to allow for downstream reading.
|
||||
r.Body = io.NopCloser(bytes.NewBuffer(buf))
|
||||
|
||||
if len(buf) == 0 {
|
||||
return req, rawBody, close, validate.ErrBodyRequired
|
||||
}
|
||||
|
||||
rawBody = append(rawBody, buf...)
|
||||
d := jx.DecodeBytes(buf)
|
||||
|
||||
var request WebhooksPostReq
|
||||
if err := func() error {
|
||||
if err := request.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := d.Skip(); err != io.EOF {
|
||||
return errors.New("unexpected trailing data")
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
err = &ogenerrors.DecodeBodyError{
|
||||
ContentType: ct,
|
||||
Body: buf,
|
||||
Err: err,
|
||||
}
|
||||
return req, rawBody, close, err
|
||||
}
|
||||
if err := func() error {
|
||||
if err := request.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return req, rawBody, close, errors.Wrap(err, "validate")
|
||||
}
|
||||
return &request, rawBody, close, nil
|
||||
default:
|
||||
return req, rawBody, close, validate.InvalidContentType(ct)
|
||||
}
|
||||
}
|
||||
137
internal/service/yookassa/gen/oas_request_encoders_gen.go
Normal file
137
internal/service/yookassa/gen/oas_request_encoders_gen.go
Normal file
@@ -0,0 +1,137 @@
|
||||
// Code generated by ogen, DO NOT EDIT.
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"net/http"
|
||||
|
||||
"github.com/go-faster/jx"
|
||||
ht "github.com/ogen-go/ogen/http"
|
||||
)
|
||||
|
||||
func encodeDealsPostRequest(
|
||||
req *SafeDealRequest,
|
||||
r *http.Request,
|
||||
) error {
|
||||
const contentType = "application/json"
|
||||
e := new(jx.Encoder)
|
||||
{
|
||||
req.Encode(e)
|
||||
}
|
||||
encoded := e.Bytes()
|
||||
ht.SetBody(r, bytes.NewReader(encoded), contentType)
|
||||
return nil
|
||||
}
|
||||
|
||||
func encodePaymentMethodsPostRequest(
|
||||
req PaymentMethodsPostReq,
|
||||
r *http.Request,
|
||||
) error {
|
||||
const contentType = "application/json"
|
||||
e := new(jx.Encoder)
|
||||
{
|
||||
req.Encode(e)
|
||||
}
|
||||
encoded := e.Bytes()
|
||||
ht.SetBody(r, bytes.NewReader(encoded), contentType)
|
||||
return nil
|
||||
}
|
||||
|
||||
func encodePaymentsPaymentIDCapturePostRequest(
|
||||
req *PaymentsPaymentIDCapturePostReq,
|
||||
r *http.Request,
|
||||
) error {
|
||||
const contentType = "application/json"
|
||||
e := new(jx.Encoder)
|
||||
{
|
||||
req.Encode(e)
|
||||
}
|
||||
encoded := e.Bytes()
|
||||
ht.SetBody(r, bytes.NewReader(encoded), contentType)
|
||||
return nil
|
||||
}
|
||||
|
||||
func encodePaymentsPostRequest(
|
||||
req *PaymentsPostReq,
|
||||
r *http.Request,
|
||||
) error {
|
||||
const contentType = "application/json"
|
||||
e := new(jx.Encoder)
|
||||
{
|
||||
req.Encode(e)
|
||||
}
|
||||
encoded := e.Bytes()
|
||||
ht.SetBody(r, bytes.NewReader(encoded), contentType)
|
||||
return nil
|
||||
}
|
||||
|
||||
func encodePayoutsPostRequest(
|
||||
req *PayoutRequest,
|
||||
r *http.Request,
|
||||
) error {
|
||||
const contentType = "application/json"
|
||||
e := new(jx.Encoder)
|
||||
{
|
||||
req.Encode(e)
|
||||
}
|
||||
encoded := e.Bytes()
|
||||
ht.SetBody(r, bytes.NewReader(encoded), contentType)
|
||||
return nil
|
||||
}
|
||||
|
||||
func encodePersonalDataPostRequest(
|
||||
req PersonalDataPostReq,
|
||||
r *http.Request,
|
||||
) error {
|
||||
const contentType = "application/json"
|
||||
e := new(jx.Encoder)
|
||||
{
|
||||
req.Encode(e)
|
||||
}
|
||||
encoded := e.Bytes()
|
||||
ht.SetBody(r, bytes.NewReader(encoded), contentType)
|
||||
return nil
|
||||
}
|
||||
|
||||
func encodeReceiptsPostRequest(
|
||||
req PostReceiptData,
|
||||
r *http.Request,
|
||||
) error {
|
||||
const contentType = "application/json"
|
||||
e := new(jx.Encoder)
|
||||
{
|
||||
req.Encode(e)
|
||||
}
|
||||
encoded := e.Bytes()
|
||||
ht.SetBody(r, bytes.NewReader(encoded), contentType)
|
||||
return nil
|
||||
}
|
||||
|
||||
func encodeRefundsPostRequest(
|
||||
req *RefundsPostReq,
|
||||
r *http.Request,
|
||||
) error {
|
||||
const contentType = "application/json"
|
||||
e := new(jx.Encoder)
|
||||
{
|
||||
req.Encode(e)
|
||||
}
|
||||
encoded := e.Bytes()
|
||||
ht.SetBody(r, bytes.NewReader(encoded), contentType)
|
||||
return nil
|
||||
}
|
||||
|
||||
func encodeWebhooksPostRequest(
|
||||
req *WebhooksPostReq,
|
||||
r *http.Request,
|
||||
) error {
|
||||
const contentType = "application/json"
|
||||
e := new(jx.Encoder)
|
||||
{
|
||||
req.Encode(e)
|
||||
}
|
||||
encoded := e.Bytes()
|
||||
ht.SetBody(r, bytes.NewReader(encoded), contentType)
|
||||
return nil
|
||||
}
|
||||
7031
internal/service/yookassa/gen/oas_response_decoders_gen.go
Normal file
7031
internal/service/yookassa/gen/oas_response_decoders_gen.go
Normal file
File diff suppressed because it is too large
Load Diff
2229
internal/service/yookassa/gen/oas_response_encoders_gen.go
Normal file
2229
internal/service/yookassa/gen/oas_response_encoders_gen.go
Normal file
File diff suppressed because it is too large
Load Diff
1691
internal/service/yookassa/gen/oas_router_gen.go
Normal file
1691
internal/service/yookassa/gen/oas_router_gen.go
Normal file
File diff suppressed because it is too large
Load Diff
24790
internal/service/yookassa/gen/oas_schemas_gen.go
Normal file
24790
internal/service/yookassa/gen/oas_schemas_gen.go
Normal file
File diff suppressed because it is too large
Load Diff
207
internal/service/yookassa/gen/oas_security_gen.go
Normal file
207
internal/service/yookassa/gen/oas_security_gen.go
Normal file
@@ -0,0 +1,207 @@
|
||||
// Code generated by ogen, DO NOT EDIT.
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/go-faster/errors"
|
||||
"github.com/ogen-go/ogen/ogenerrors"
|
||||
)
|
||||
|
||||
// SecurityHandler is handler for security parameters.
|
||||
type SecurityHandler interface {
|
||||
// HandleBasicAuth handles BasicAuth security.
|
||||
// HTTP Basic аутентификация клиента ЮKassa.
|
||||
HandleBasicAuth(ctx context.Context, operationName OperationName, t BasicAuth) (context.Context, error)
|
||||
// HandleOAuth2 handles OAuth2 security.
|
||||
// Авторизация клиента ЮKassa с использованием OAuth-токена.
|
||||
HandleOAuth2(ctx context.Context, operationName OperationName, t OAuth2) (context.Context, error)
|
||||
}
|
||||
|
||||
func findAuthorization(h http.Header, prefix string) (string, bool) {
|
||||
v, ok := h["Authorization"]
|
||||
if !ok {
|
||||
return "", false
|
||||
}
|
||||
for _, vv := range v {
|
||||
scheme, value, ok := strings.Cut(vv, " ")
|
||||
if !ok || !strings.EqualFold(scheme, prefix) {
|
||||
continue
|
||||
}
|
||||
return value, true
|
||||
}
|
||||
return "", false
|
||||
}
|
||||
|
||||
// operationRolesBasicAuth is a private map storing roles per operation.
|
||||
var operationRolesBasicAuth = map[string][]string{
|
||||
DealsDealIDGetOperation: []string{},
|
||||
DealsGetOperation: []string{},
|
||||
DealsPostOperation: []string{},
|
||||
MeGetOperation: []string{},
|
||||
PaymentMethodsPaymentMethodIDGetOperation: []string{},
|
||||
PaymentMethodsPostOperation: []string{},
|
||||
PaymentsGetOperation: []string{},
|
||||
PaymentsPaymentIDCancelPostOperation: []string{},
|
||||
PaymentsPaymentIDCapturePostOperation: []string{},
|
||||
PaymentsPaymentIDGetOperation: []string{},
|
||||
PaymentsPostOperation: []string{},
|
||||
PayoutsGetOperation: []string{},
|
||||
PayoutsPayoutIDGetOperation: []string{},
|
||||
PayoutsPostOperation: []string{},
|
||||
PayoutsSearchGetOperation: []string{},
|
||||
PersonalDataPersonalDataIDGetOperation: []string{},
|
||||
PersonalDataPostOperation: []string{},
|
||||
ReceiptsGetOperation: []string{},
|
||||
ReceiptsPostOperation: []string{},
|
||||
ReceiptsReceiptIDGetOperation: []string{},
|
||||
RefundsGetOperation: []string{},
|
||||
RefundsPostOperation: []string{},
|
||||
RefundsRefundIDGetOperation: []string{},
|
||||
SbpBanksGetOperation: []string{},
|
||||
WebhooksGetOperation: []string{},
|
||||
WebhooksPostOperation: []string{},
|
||||
WebhooksWebhookIDDeleteOperation: []string{},
|
||||
}
|
||||
|
||||
// GetRolesForBasicAuth returns the required roles for the given operation.
|
||||
//
|
||||
// This is useful for authorization scenarios where you need to know which roles
|
||||
// are required for an operation.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// requiredRoles := GetRolesForBasicAuth(AddPetOperation)
|
||||
//
|
||||
// Returns nil if the operation has no role requirements or if the operation is unknown.
|
||||
func GetRolesForBasicAuth(operation string) []string {
|
||||
roles, ok := operationRolesBasicAuth[operation]
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
// Return a copy to prevent external modification
|
||||
result := make([]string, len(roles))
|
||||
copy(result, roles)
|
||||
return result
|
||||
}
|
||||
|
||||
// oauth2ScopesOAuth2 is a private map storing OAuth2 scopes per operation.
|
||||
var oauth2ScopesOAuth2 = map[string][]string{
|
||||
DealsDealIDGetOperation: []string{},
|
||||
DealsGetOperation: []string{},
|
||||
DealsPostOperation: []string{},
|
||||
MeGetOperation: []string{},
|
||||
PaymentMethodsPaymentMethodIDGetOperation: []string{},
|
||||
PaymentMethodsPostOperation: []string{},
|
||||
PaymentsGetOperation: []string{},
|
||||
PaymentsPaymentIDCancelPostOperation: []string{},
|
||||
PaymentsPaymentIDCapturePostOperation: []string{},
|
||||
PaymentsPaymentIDGetOperation: []string{},
|
||||
PaymentsPostOperation: []string{},
|
||||
PayoutsGetOperation: []string{},
|
||||
PayoutsPayoutIDGetOperation: []string{},
|
||||
PayoutsPostOperation: []string{},
|
||||
PayoutsSearchGetOperation: []string{},
|
||||
PersonalDataPersonalDataIDGetOperation: []string{},
|
||||
PersonalDataPostOperation: []string{},
|
||||
ReceiptsGetOperation: []string{},
|
||||
ReceiptsPostOperation: []string{},
|
||||
ReceiptsReceiptIDGetOperation: []string{},
|
||||
RefundsGetOperation: []string{},
|
||||
RefundsPostOperation: []string{},
|
||||
RefundsRefundIDGetOperation: []string{},
|
||||
SbpBanksGetOperation: []string{},
|
||||
WebhooksGetOperation: []string{},
|
||||
WebhooksPostOperation: []string{},
|
||||
WebhooksWebhookIDDeleteOperation: []string{},
|
||||
}
|
||||
|
||||
// GetOAuth2ScopesForOAuth2 returns the required OAuth2 scopes for the given operation.
|
||||
//
|
||||
// This is useful for token exchange scenarios where you need to know which scopes
|
||||
// to request when obtaining a token for a downstream API call.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// requiredScopes := GetOAuth2ScopesForOAuth2(AddPetOperation)
|
||||
// token := exchangeTokenWithScopes(requiredScopes, "https://api.example.com")
|
||||
//
|
||||
// Returns nil if the operation has no scope requirements or if the operation is unknown.
|
||||
func GetOAuth2ScopesForOAuth2(operation string) []string {
|
||||
scopes, ok := oauth2ScopesOAuth2[operation]
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
// Return a copy to prevent external modification
|
||||
result := make([]string, len(scopes))
|
||||
copy(result, scopes)
|
||||
return result
|
||||
}
|
||||
|
||||
func (s *Server) securityBasicAuth(ctx context.Context, operationName OperationName, req *http.Request) (context.Context, bool, error) {
|
||||
var t BasicAuth
|
||||
if _, ok := findAuthorization(req.Header, "Basic"); !ok {
|
||||
return ctx, false, nil
|
||||
}
|
||||
username, password, ok := req.BasicAuth()
|
||||
if !ok {
|
||||
return nil, false, errors.New("invalid basic auth")
|
||||
}
|
||||
t.Username = username
|
||||
t.Password = password
|
||||
t.Roles = operationRolesBasicAuth[operationName]
|
||||
rctx, err := s.sec.HandleBasicAuth(ctx, operationName, t)
|
||||
if errors.Is(err, ogenerrors.ErrSkipServerSecurity) {
|
||||
return nil, false, nil
|
||||
} else if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
return rctx, true, err
|
||||
}
|
||||
|
||||
func (s *Server) securityOAuth2(ctx context.Context, operationName OperationName, req *http.Request) (context.Context, bool, error) {
|
||||
var t OAuth2
|
||||
token, ok := findAuthorization(req.Header, "Bearer")
|
||||
if !ok {
|
||||
return ctx, false, nil
|
||||
}
|
||||
t.Token = token
|
||||
t.Scopes = oauth2ScopesOAuth2[operationName]
|
||||
rctx, err := s.sec.HandleOAuth2(ctx, operationName, t)
|
||||
if errors.Is(err, ogenerrors.ErrSkipServerSecurity) {
|
||||
return nil, false, nil
|
||||
} else if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
return rctx, true, err
|
||||
}
|
||||
|
||||
// SecuritySource is provider of security values (tokens, passwords, etc.).
|
||||
type SecuritySource interface {
|
||||
// BasicAuth provides BasicAuth security value.
|
||||
// HTTP Basic аутентификация клиента ЮKassa.
|
||||
BasicAuth(ctx context.Context, operationName OperationName) (BasicAuth, error)
|
||||
// OAuth2 provides OAuth2 security value.
|
||||
// Авторизация клиента ЮKassa с использованием OAuth-токена.
|
||||
OAuth2(ctx context.Context, operationName OperationName) (OAuth2, error)
|
||||
}
|
||||
|
||||
func (s *Client) securityBasicAuth(ctx context.Context, operationName OperationName, req *http.Request) error {
|
||||
t, err := s.sec.BasicAuth(ctx, operationName)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "security source \"BasicAuth\"")
|
||||
}
|
||||
req.SetBasicAuth(t.Username, t.Password)
|
||||
return nil
|
||||
}
|
||||
func (s *Client) securityOAuth2(ctx context.Context, operationName OperationName, req *http.Request) error {
|
||||
t, err := s.sec.OAuth2(ctx, operationName)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "security source \"OAuth2\"")
|
||||
}
|
||||
req.Header.Set("Authorization", "Bearer "+t.Token)
|
||||
return nil
|
||||
}
|
||||
316
internal/service/yookassa/gen/oas_server_gen.go
Normal file
316
internal/service/yookassa/gen/oas_server_gen.go
Normal file
@@ -0,0 +1,316 @@
|
||||
// Code generated by ogen, DO NOT EDIT.
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
// Handler handles operations described by OpenAPI v3 specification.
|
||||
type Handler interface {
|
||||
// DealsDealIDGet implements GET /deals/{deal_id} operation.
|
||||
//
|
||||
// Запрос позволяет получить информацию о текущем
|
||||
// состоянии сделки по ее уникальному идентификатору.
|
||||
//
|
||||
// GET /deals/{deal_id}
|
||||
DealsDealIDGet(ctx context.Context, params DealsDealIDGetParams) (DealsDealIDGetRes, error)
|
||||
// DealsGet implements GET /deals operation.
|
||||
//
|
||||
// Запрос позволяет получить список сделок,
|
||||
// отфильтрованный по заданным критериям. Подробнее о
|
||||
// работе со списками: https://yookassa.ru/developers/using-api/lists.
|
||||
//
|
||||
// GET /deals
|
||||
DealsGet(ctx context.Context, params DealsGetParams) (DealsGetRes, error)
|
||||
// DealsPost implements POST /deals operation.
|
||||
//
|
||||
// Запрос позволяет создать сделку, в рамках которой
|
||||
// необходимо принять оплату от покупателя и
|
||||
// перечислить ее продавцу.
|
||||
//
|
||||
// POST /deals
|
||||
DealsPost(ctx context.Context, req *SafeDealRequest, params DealsPostParams) (DealsPostRes, error)
|
||||
// MeGet implements GET /me operation.
|
||||
//
|
||||
// С помощью этого запроса вы можете получить
|
||||
// информацию о магазине или шлюзе: * Для Сплитования
|
||||
// платежей: https://yookassa.ru/developers/solutions-for-platforms/split-payments/basics: в
|
||||
// запросе необходимо передать параметр on_behalf_of с
|
||||
// идентификатором магазина продавца и ваши данные для
|
||||
// аутентификации: https://yookassa.ru/developers/using-api/interaction-format#auth
|
||||
// (идентификатор и секретный ключ вашей платформы). *
|
||||
// Для партнеров: https://yookassa.
|
||||
// ru/developers/solutions-for-platforms/partners-api/basics: в запросе необходимо
|
||||
// передать OAuth-токен магазина. * Для выплат: https://yookassa.
|
||||
// ru/developers/payouts/overview: в запросе необходимо передать ваши
|
||||
// данные для аутентификации: https://yookassa.
|
||||
// ru/developers/using-api/interaction-format#auth (идентификатор и секретный
|
||||
// ключ вашего шлюза).
|
||||
//
|
||||
// GET /me
|
||||
MeGet(ctx context.Context, params MeGetParams) (MeGetRes, error)
|
||||
// PaymentMethodsPaymentMethodIDGet implements GET /payment_methods/{payment_method_id} operation.
|
||||
//
|
||||
// Используйте этот запрос, чтобы получить информацию о
|
||||
// текущем состоянии способа оплаты по его уникальному
|
||||
// идентификатору.
|
||||
//
|
||||
// GET /payment_methods/{payment_method_id}
|
||||
PaymentMethodsPaymentMethodIDGet(ctx context.Context, params PaymentMethodsPaymentMethodIDGetParams) (PaymentMethodsPaymentMethodIDGetRes, error)
|
||||
// PaymentMethodsPost implements POST /payment_methods operation.
|
||||
//
|
||||
// Используйте этот запрос, чтобы создать в ЮKassa объект
|
||||
// способа оплаты: https://yookassa.ru/developers/api#payment_method_object. В
|
||||
// запросе необходимо передать код способа оплаты,
|
||||
// который вы хотите сохранить, и при необходимости
|
||||
// дополнительные параметры, связанные с той
|
||||
// функциональностью, которую вы хотите использовать.
|
||||
// Идентификатор созданного способа оплаты вы можете
|
||||
// использовать при проведении автоплатежей: https://yookassa.
|
||||
// ru/developers/payment-acceptance/scenario-extensions/recurring-payments/create-recurring или
|
||||
// выплат: https://yookassa.ru/developers/payouts/scenario-extensions/multipurpose-token.
|
||||
//
|
||||
// POST /payment_methods
|
||||
PaymentMethodsPost(ctx context.Context, req PaymentMethodsPostReq, params PaymentMethodsPostParams) (PaymentMethodsPostRes, error)
|
||||
// PaymentsGet implements GET /payments operation.
|
||||
//
|
||||
// Use this request to get a list of payments. You can download payments created over the last 3
|
||||
// years. You can filter the list by specified criteria. More about working with lists:
|
||||
// https://yookassa.ru/developers/using-api/lists.
|
||||
//
|
||||
// GET /payments
|
||||
PaymentsGet(ctx context.Context, params PaymentsGetParams) (PaymentsGetRes, error)
|
||||
// PaymentsPaymentIDCancelPost implements POST /payments/{payment_id}/cancel operation.
|
||||
//
|
||||
// Cancel payments with the waiting_for_capture status. Payment cancelation means you are not ready
|
||||
// to dispatch a product or to provide a service to the user. Once you cancel the payment, we will
|
||||
// start returning the money to the payer’s account. If the payment was made from a bank card, a
|
||||
// YooMoney wallet, or via SberPay, the money will be refunded instantly. If the payment was made
|
||||
// using other payment methods, the process can take up to several days. More about capturing and
|
||||
// canceling payments: https://yookassa.
|
||||
// ru/developers/payment-acceptance/getting-started/payment-process#capture-and-cancel.
|
||||
//
|
||||
// POST /payments/{payment_id}/cancel
|
||||
PaymentsPaymentIDCancelPost(ctx context.Context, params PaymentsPaymentIDCancelPostParams) (PaymentsPaymentIDCancelPostRes, error)
|
||||
// PaymentsPaymentIDCapturePost implements POST /payments/{payment_id}/capture operation.
|
||||
//
|
||||
// Confirm you’re ready to accept the payment. Once the payment is captured, the status will change
|
||||
// to succeeded. After that, you can provide the customer with the product or service. You can only
|
||||
// capture payments with the waiting_for_capture status, and only for a certain amount of time
|
||||
// (depending on the payment method). If you do not capture the payment within the allotted time, the
|
||||
// status will change to canceled, and the money will be returned to the user. More about capturing
|
||||
// and canceling payments: https://yookassa.
|
||||
// ru/developers/payment-acceptance/getting-started/payment-process#capture-and-cancel.
|
||||
//
|
||||
// POST /payments/{payment_id}/capture
|
||||
PaymentsPaymentIDCapturePost(ctx context.Context, req *PaymentsPaymentIDCapturePostReq, params PaymentsPaymentIDCapturePostParams) (PaymentsPaymentIDCapturePostRes, error)
|
||||
// PaymentsPaymentIDGet implements GET /payments/{payment_id} operation.
|
||||
//
|
||||
// This request allows you to get the information about the current payment status by its unique ID.
|
||||
//
|
||||
// GET /payments/{payment_id}
|
||||
PaymentsPaymentIDGet(ctx context.Context, params PaymentsPaymentIDGetParams) (PaymentsPaymentIDGetRes, error)
|
||||
// PaymentsPost implements POST /payments operation.
|
||||
//
|
||||
// To accept a payment, you need to create a payment object: https://yookassa.
|
||||
// ru/developers/api#payment_object, Payment. It contains all the necessary payment information
|
||||
// (amount, currency, and status). Payments have a linear life cycle, going from one status to the
|
||||
// next sequentially.
|
||||
//
|
||||
// POST /payments
|
||||
PaymentsPost(ctx context.Context, req *PaymentsPostReq, params PaymentsPostParams) (PaymentsPostRes, error)
|
||||
// PayoutsGet implements GET /payouts operation.
|
||||
//
|
||||
// Use this request to get a list of payouts. You can download payments created over the last 3 years.
|
||||
// You can filter the list by specified criteria. Request authentication details: https://yookassa.
|
||||
// ru/developers/using-api/interaction-format#auth depend on which payment solution you are using:
|
||||
// basic payouts: https://yookassa.ru/developers/payouts/overview or payouts within the Safe Deal:
|
||||
// https://yookassa.ru/developers/solutions-for-platforms/safe-deal/basics. More about working with
|
||||
// lists: https://yookassa.ru/developers/using-api/lists.
|
||||
//
|
||||
// GET /payouts
|
||||
PayoutsGet(ctx context.Context, params PayoutsGetParams) (PayoutsGetRes, error)
|
||||
// PayoutsPayoutIDGet implements GET /payouts/{payout_id} operation.
|
||||
//
|
||||
// Используйте этот запрос, чтобы получить информацию о
|
||||
// текущем состоянии выплаты по ее уникальному
|
||||
// идентификатору. Данные для аутентификации: https://yookassa.
|
||||
// ru/developers/using-api/interaction-format#auth запросов зависят от того,
|
||||
// какое платежное решение вы используете — обычные
|
||||
// выплаты: https://yookassa.ru/developers/payouts/overview или выплаты в
|
||||
// рамках Безопасной сделки: https://yookassa.
|
||||
// ru/developers/solutions-for-platforms/safe-deal/basics.
|
||||
//
|
||||
// GET /payouts/{payout_id}
|
||||
PayoutsPayoutIDGet(ctx context.Context, params PayoutsPayoutIDGetParams) (PayoutsPayoutIDGetRes, error)
|
||||
// PayoutsPost implements POST /payouts operation.
|
||||
//
|
||||
// Используйте этот запрос, чтобы создать в ЮKassa объект
|
||||
// выплаты: https://yookassa.ru/developers/api#payout_object. В запросе
|
||||
// необходимо передать сумму выплаты, данные о способе
|
||||
// получения выплаты (например, номер кошелька ЮMoney),
|
||||
// описание выплаты и при необходимости дополнительные
|
||||
// параметры, связанные с той функциональностью,
|
||||
// которую вы хотите использовать. Передаваемые
|
||||
// параметры и данные для аутентификации: https://yookassa.
|
||||
// ru/developers/using-api/interaction-format#auth запросов зависят от того,
|
||||
// какое платежное решение вы используете — обычные
|
||||
// выплаты: https://yookassa.ru/developers/payouts/overview или выплаты в
|
||||
// рамках Безопасной сделки: https://yookassa.
|
||||
// ru/developers/solutions-for-platforms/safe-deal/basics.
|
||||
//
|
||||
// POST /payouts
|
||||
PayoutsPost(ctx context.Context, req *PayoutRequest, params PayoutsPostParams) (PayoutsPostRes, error)
|
||||
// PayoutsSearchGet implements GET /payouts/search operation.
|
||||
//
|
||||
// Use this request to search for payouts by the specified criteria. Available only for payouts
|
||||
// created over the last 3 months. At this time, only search by the metadata parameter is available.
|
||||
// You can also specify the date and time when the payout was created (the created_at parameter).
|
||||
// Request authentication details: https://yookassa.ru/developers/using-api/interaction-format#auth
|
||||
// depend on which payment solution you are using: basic payouts: https://yookassa.
|
||||
// ru/developers/payouts/overview or payouts within the Safe Deal: https://yookassa.
|
||||
// ru/developers/solutions-for-platforms/safe-deal/basics.
|
||||
//
|
||||
// GET /payouts/search
|
||||
PayoutsSearchGet(ctx context.Context, params PayoutsSearchGetParams) (PayoutsSearchGetRes, error)
|
||||
// PersonalDataPersonalDataIDGet implements GET /personal_data/{personal_data_id} operation.
|
||||
//
|
||||
// С помощью этого запроса вы можете получить
|
||||
// информацию о текущем статусе объекта персональных
|
||||
// данных по его уникальному идентификатору.
|
||||
//
|
||||
// GET /personal_data/{personal_data_id}
|
||||
PersonalDataPersonalDataIDGet(ctx context.Context, params PersonalDataPersonalDataIDGetParams) (PersonalDataPersonalDataIDGetRes, error)
|
||||
// PersonalDataPost implements POST /personal_data operation.
|
||||
//
|
||||
// Используйте этот запрос, чтобы создать в ЮKassa объект
|
||||
// персональных данных: https://yookassa.ru/developers/api#personal_data_object. В
|
||||
// запросе необходимо указать тип данных (с какой целью
|
||||
// они будут использоваться) и передать информацию о
|
||||
// пользователе: фамилию, имя, отчество и другие — в
|
||||
// зависимости от выбранного типа. Идентификатор
|
||||
// созданного объекта персональных данных необходимо
|
||||
// использовать в запросе на создание выплаты: https://yookassa.
|
||||
// ru/developers/api#create_payout.
|
||||
//
|
||||
// POST /personal_data
|
||||
PersonalDataPost(ctx context.Context, req PersonalDataPostReq, params PersonalDataPostParams) (PersonalDataPostRes, error)
|
||||
// ReceiptsGet implements GET /receipts operation.
|
||||
//
|
||||
// Запрос позволяет получить список чеков,
|
||||
// отфильтрованный по заданным критериям. Можно
|
||||
// запросить чеки по конкретному платежу, чеки по
|
||||
// конкретному возврату или все чеки магазина.
|
||||
// Подробнее о работе со списками: https://yookassa.
|
||||
// ru/developers/using-api/lists.
|
||||
//
|
||||
// GET /receipts
|
||||
ReceiptsGet(ctx context.Context, params ReceiptsGetParams) (ReceiptsGetRes, error)
|
||||
// ReceiptsPost implements POST /receipts operation.
|
||||
//
|
||||
// Используйте этот запрос при оплате с соблюдением
|
||||
// требований 54-ФЗ: https://yookassa.
|
||||
// ru/developers/payment-acceptance/receipts/54fz/basics, чтобы создать чек
|
||||
// зачета предоплаты. Если вы работаете по сценарию
|
||||
// Сначала платеж, потом чек: https://yookassa.
|
||||
// ru/developers/payment-acceptance/receipts/54fz/other-services/basics#receipt-after-payment, в
|
||||
// запросе также нужно передавать данные для
|
||||
// формирования чека прихода и чека возврата прихода.
|
||||
//
|
||||
// POST /receipts
|
||||
ReceiptsPost(ctx context.Context, req PostReceiptData, params ReceiptsPostParams) (ReceiptsPostRes, error)
|
||||
// ReceiptsReceiptIDGet implements GET /receipts/{receipt_id} operation.
|
||||
//
|
||||
// Запрос позволяет получить информацию о текущем
|
||||
// состоянии чека по его уникальному идентификатору.
|
||||
//
|
||||
// GET /receipts/{receipt_id}
|
||||
ReceiptsReceiptIDGet(ctx context.Context, params ReceiptsReceiptIDGetParams) (ReceiptsReceiptIDGetRes, error)
|
||||
// RefundsGet implements GET /refunds operation.
|
||||
//
|
||||
// Use this request to get a list of refunds. You can download refunds created over the last 3 years.
|
||||
// You can filter the list by specified criteria. More about working with lists: https://yookassa.
|
||||
// ru/developers/using-api/lists.
|
||||
//
|
||||
// GET /refunds
|
||||
RefundsGet(ctx context.Context, params RefundsGetParams) (RefundsGetRes, error)
|
||||
// RefundsPost implements POST /refunds operation.
|
||||
//
|
||||
// Создает возврат успешного платежа на указанную сумму.
|
||||
// Платеж можно вернуть только в течение трех лет с
|
||||
// момента его создания: https://yookassa.ru/developers/api#create_payment.
|
||||
// Комиссия ЮKassa за проведение платежа не возвращается.
|
||||
//
|
||||
// POST /refunds
|
||||
RefundsPost(ctx context.Context, req *RefundsPostReq, params RefundsPostParams) (RefundsPostRes, error)
|
||||
// RefundsRefundIDGet implements GET /refunds/{refund_id} operation.
|
||||
//
|
||||
// Запрос позволяет получить информацию о текущем
|
||||
// состоянии возврата по его уникальному
|
||||
// идентификатору.
|
||||
//
|
||||
// GET /refunds/{refund_id}
|
||||
RefundsRefundIDGet(ctx context.Context, params RefundsRefundIDGetParams) (RefundsRefundIDGetRes, error)
|
||||
// SbpBanksGet implements GET /sbp_banks operation.
|
||||
//
|
||||
// С помощью этого запроса вы можете получить
|
||||
// актуальный список всех участников СБП. Список нужно
|
||||
// вывести получателю выплаты, идентификатор
|
||||
// выбранного участника СБП необходимо использовать в
|
||||
// запросе на создание выплаты: https://yookassa.
|
||||
// ru/developers/api#create_payout. Подробнее о выплатах через СБП:
|
||||
// https://yookassa.ru/developers/payouts/making-payouts/sbp.
|
||||
//
|
||||
// GET /sbp_banks
|
||||
SbpBanksGet(ctx context.Context) (SbpBanksGetRes, error)
|
||||
// WebhooksGet implements GET /webhooks operation.
|
||||
//
|
||||
// Запрос позволяет узнать, какие webhook есть для
|
||||
// переданного OAuth-токена.
|
||||
//
|
||||
// GET /webhooks
|
||||
WebhooksGet(ctx context.Context) (WebhooksGetRes, error)
|
||||
// WebhooksPost implements POST /webhooks operation.
|
||||
//
|
||||
// Запрос позволяет подписаться на уведомления о
|
||||
// событиях: https://yookassa.ru/developers/using-api/webhooks#events (например,
|
||||
// переход платежа в статус succeeded). C помощью webhook можно
|
||||
// подписаться только на события платежей и возвратов.
|
||||
// Если вы хотите получать уведомления о нескольких
|
||||
// событиях, вам нужно для каждого из них создать свой
|
||||
// webhook. Для каждого OAuth-токена нужно создавать свой
|
||||
// набор webhook.
|
||||
//
|
||||
// POST /webhooks
|
||||
WebhooksPost(ctx context.Context, req *WebhooksPostReq, params WebhooksPostParams) (WebhooksPostRes, error)
|
||||
// WebhooksWebhookIDDelete implements DELETE /webhooks/{webhook_id} operation.
|
||||
//
|
||||
// Запрос позволяет отписаться от уведомлений о событии
|
||||
// для переданного OAuth-токена. Чтобы удалить webhook, вам
|
||||
// нужно передать в запросе его идентификатор.
|
||||
//
|
||||
// DELETE /webhooks/{webhook_id}
|
||||
WebhooksWebhookIDDelete(ctx context.Context, params WebhooksWebhookIDDeleteParams) (WebhooksWebhookIDDeleteRes, error)
|
||||
}
|
||||
|
||||
// Server implements http server based on OpenAPI v3 specification and
|
||||
// calls Handler to handle requests.
|
||||
type Server struct {
|
||||
h Handler
|
||||
sec SecurityHandler
|
||||
baseServer
|
||||
}
|
||||
|
||||
// NewServer creates new Server.
|
||||
func NewServer(h Handler, sec SecurityHandler, opts ...ServerOption) (*Server, error) {
|
||||
s, err := newServerConfig(opts...).baseServer()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &Server{
|
||||
h: h,
|
||||
sec: sec,
|
||||
baseServer: s,
|
||||
}, nil
|
||||
}
|
||||
383
internal/service/yookassa/gen/oas_unimplemented_gen.go
Normal file
383
internal/service/yookassa/gen/oas_unimplemented_gen.go
Normal file
@@ -0,0 +1,383 @@
|
||||
// Code generated by ogen, DO NOT EDIT.
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
ht "github.com/ogen-go/ogen/http"
|
||||
)
|
||||
|
||||
// UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
|
||||
type UnimplementedHandler struct{}
|
||||
|
||||
var _ Handler = UnimplementedHandler{}
|
||||
|
||||
// DealsDealIDGet implements GET /deals/{deal_id} operation.
|
||||
//
|
||||
// Запрос позволяет получить информацию о текущем
|
||||
// состоянии сделки по ее уникальному идентификатору.
|
||||
//
|
||||
// GET /deals/{deal_id}
|
||||
func (UnimplementedHandler) DealsDealIDGet(ctx context.Context, params DealsDealIDGetParams) (r DealsDealIDGetRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// DealsGet implements GET /deals operation.
|
||||
//
|
||||
// Запрос позволяет получить список сделок,
|
||||
// отфильтрованный по заданным критериям. Подробнее о
|
||||
// работе со списками: https://yookassa.ru/developers/using-api/lists.
|
||||
//
|
||||
// GET /deals
|
||||
func (UnimplementedHandler) DealsGet(ctx context.Context, params DealsGetParams) (r DealsGetRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// DealsPost implements POST /deals operation.
|
||||
//
|
||||
// Запрос позволяет создать сделку, в рамках которой
|
||||
// необходимо принять оплату от покупателя и
|
||||
// перечислить ее продавцу.
|
||||
//
|
||||
// POST /deals
|
||||
func (UnimplementedHandler) DealsPost(ctx context.Context, req *SafeDealRequest, params DealsPostParams) (r DealsPostRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// MeGet implements GET /me operation.
|
||||
//
|
||||
// С помощью этого запроса вы можете получить
|
||||
// информацию о магазине или шлюзе: * Для Сплитования
|
||||
// платежей: https://yookassa.ru/developers/solutions-for-platforms/split-payments/basics: в
|
||||
// запросе необходимо передать параметр on_behalf_of с
|
||||
// идентификатором магазина продавца и ваши данные для
|
||||
// аутентификации: https://yookassa.ru/developers/using-api/interaction-format#auth
|
||||
// (идентификатор и секретный ключ вашей платформы). *
|
||||
// Для партнеров: https://yookassa.
|
||||
// ru/developers/solutions-for-platforms/partners-api/basics: в запросе необходимо
|
||||
// передать OAuth-токен магазина. * Для выплат: https://yookassa.
|
||||
// ru/developers/payouts/overview: в запросе необходимо передать ваши
|
||||
// данные для аутентификации: https://yookassa.
|
||||
// ru/developers/using-api/interaction-format#auth (идентификатор и секретный
|
||||
// ключ вашего шлюза).
|
||||
//
|
||||
// GET /me
|
||||
func (UnimplementedHandler) MeGet(ctx context.Context, params MeGetParams) (r MeGetRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// PaymentMethodsPaymentMethodIDGet implements GET /payment_methods/{payment_method_id} operation.
|
||||
//
|
||||
// Используйте этот запрос, чтобы получить информацию о
|
||||
// текущем состоянии способа оплаты по его уникальному
|
||||
// идентификатору.
|
||||
//
|
||||
// GET /payment_methods/{payment_method_id}
|
||||
func (UnimplementedHandler) PaymentMethodsPaymentMethodIDGet(ctx context.Context, params PaymentMethodsPaymentMethodIDGetParams) (r PaymentMethodsPaymentMethodIDGetRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// PaymentMethodsPost implements POST /payment_methods operation.
|
||||
//
|
||||
// Используйте этот запрос, чтобы создать в ЮKassa объект
|
||||
// способа оплаты: https://yookassa.ru/developers/api#payment_method_object. В
|
||||
// запросе необходимо передать код способа оплаты,
|
||||
// который вы хотите сохранить, и при необходимости
|
||||
// дополнительные параметры, связанные с той
|
||||
// функциональностью, которую вы хотите использовать.
|
||||
// Идентификатор созданного способа оплаты вы можете
|
||||
// использовать при проведении автоплатежей: https://yookassa.
|
||||
// ru/developers/payment-acceptance/scenario-extensions/recurring-payments/create-recurring или
|
||||
// выплат: https://yookassa.ru/developers/payouts/scenario-extensions/multipurpose-token.
|
||||
//
|
||||
// POST /payment_methods
|
||||
func (UnimplementedHandler) PaymentMethodsPost(ctx context.Context, req PaymentMethodsPostReq, params PaymentMethodsPostParams) (r PaymentMethodsPostRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// PaymentsGet implements GET /payments operation.
|
||||
//
|
||||
// Use this request to get a list of payments. You can download payments created over the last 3
|
||||
// years. You can filter the list by specified criteria. More about working with lists:
|
||||
// https://yookassa.ru/developers/using-api/lists.
|
||||
//
|
||||
// GET /payments
|
||||
func (UnimplementedHandler) PaymentsGet(ctx context.Context, params PaymentsGetParams) (r PaymentsGetRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// PaymentsPaymentIDCancelPost implements POST /payments/{payment_id}/cancel operation.
|
||||
//
|
||||
// Cancel payments with the waiting_for_capture status. Payment cancelation means you are not ready
|
||||
// to dispatch a product or to provide a service to the user. Once you cancel the payment, we will
|
||||
// start returning the money to the payer’s account. If the payment was made from a bank card, a
|
||||
// YooMoney wallet, or via SberPay, the money will be refunded instantly. If the payment was made
|
||||
// using other payment methods, the process can take up to several days. More about capturing and
|
||||
// canceling payments: https://yookassa.
|
||||
// ru/developers/payment-acceptance/getting-started/payment-process#capture-and-cancel.
|
||||
//
|
||||
// POST /payments/{payment_id}/cancel
|
||||
func (UnimplementedHandler) PaymentsPaymentIDCancelPost(ctx context.Context, params PaymentsPaymentIDCancelPostParams) (r PaymentsPaymentIDCancelPostRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// PaymentsPaymentIDCapturePost implements POST /payments/{payment_id}/capture operation.
|
||||
//
|
||||
// Confirm you’re ready to accept the payment. Once the payment is captured, the status will change
|
||||
// to succeeded. After that, you can provide the customer with the product or service. You can only
|
||||
// capture payments with the waiting_for_capture status, and only for a certain amount of time
|
||||
// (depending on the payment method). If you do not capture the payment within the allotted time, the
|
||||
// status will change to canceled, and the money will be returned to the user. More about capturing
|
||||
// and canceling payments: https://yookassa.
|
||||
// ru/developers/payment-acceptance/getting-started/payment-process#capture-and-cancel.
|
||||
//
|
||||
// POST /payments/{payment_id}/capture
|
||||
func (UnimplementedHandler) PaymentsPaymentIDCapturePost(ctx context.Context, req *PaymentsPaymentIDCapturePostReq, params PaymentsPaymentIDCapturePostParams) (r PaymentsPaymentIDCapturePostRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// PaymentsPaymentIDGet implements GET /payments/{payment_id} operation.
|
||||
//
|
||||
// This request allows you to get the information about the current payment status by its unique ID.
|
||||
//
|
||||
// GET /payments/{payment_id}
|
||||
func (UnimplementedHandler) PaymentsPaymentIDGet(ctx context.Context, params PaymentsPaymentIDGetParams) (r PaymentsPaymentIDGetRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// PaymentsPost implements POST /payments operation.
|
||||
//
|
||||
// To accept a payment, you need to create a payment object: https://yookassa.
|
||||
// ru/developers/api#payment_object, Payment. It contains all the necessary payment information
|
||||
// (amount, currency, and status). Payments have a linear life cycle, going from one status to the
|
||||
// next sequentially.
|
||||
//
|
||||
// POST /payments
|
||||
func (UnimplementedHandler) PaymentsPost(ctx context.Context, req *PaymentsPostReq, params PaymentsPostParams) (r PaymentsPostRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// PayoutsGet implements GET /payouts operation.
|
||||
//
|
||||
// Use this request to get a list of payouts. You can download payments created over the last 3 years.
|
||||
//
|
||||
// You can filter the list by specified criteria. Request authentication details: https://yookassa.
|
||||
//
|
||||
// ru/developers/using-api/interaction-format#auth depend on which payment solution you are using:
|
||||
// basic payouts: https://yookassa.ru/developers/payouts/overview or payouts within the Safe Deal:
|
||||
// https://yookassa.ru/developers/solutions-for-platforms/safe-deal/basics. More about working with
|
||||
// lists: https://yookassa.ru/developers/using-api/lists.
|
||||
//
|
||||
// GET /payouts
|
||||
func (UnimplementedHandler) PayoutsGet(ctx context.Context, params PayoutsGetParams) (r PayoutsGetRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// PayoutsPayoutIDGet implements GET /payouts/{payout_id} operation.
|
||||
//
|
||||
// Используйте этот запрос, чтобы получить информацию о
|
||||
// текущем состоянии выплаты по ее уникальному
|
||||
// идентификатору. Данные для аутентификации: https://yookassa.
|
||||
// ru/developers/using-api/interaction-format#auth запросов зависят от того,
|
||||
// какое платежное решение вы используете — обычные
|
||||
// выплаты: https://yookassa.ru/developers/payouts/overview или выплаты в
|
||||
// рамках Безопасной сделки: https://yookassa.
|
||||
// ru/developers/solutions-for-platforms/safe-deal/basics.
|
||||
//
|
||||
// GET /payouts/{payout_id}
|
||||
func (UnimplementedHandler) PayoutsPayoutIDGet(ctx context.Context, params PayoutsPayoutIDGetParams) (r PayoutsPayoutIDGetRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// PayoutsPost implements POST /payouts operation.
|
||||
//
|
||||
// Используйте этот запрос, чтобы создать в ЮKassa объект
|
||||
// выплаты: https://yookassa.ru/developers/api#payout_object. В запросе
|
||||
// необходимо передать сумму выплаты, данные о способе
|
||||
// получения выплаты (например, номер кошелька ЮMoney),
|
||||
// описание выплаты и при необходимости дополнительные
|
||||
// параметры, связанные с той функциональностью,
|
||||
// которую вы хотите использовать. Передаваемые
|
||||
// параметры и данные для аутентификации: https://yookassa.
|
||||
// ru/developers/using-api/interaction-format#auth запросов зависят от того,
|
||||
// какое платежное решение вы используете — обычные
|
||||
// выплаты: https://yookassa.ru/developers/payouts/overview или выплаты в
|
||||
// рамках Безопасной сделки: https://yookassa.
|
||||
// ru/developers/solutions-for-platforms/safe-deal/basics.
|
||||
//
|
||||
// POST /payouts
|
||||
func (UnimplementedHandler) PayoutsPost(ctx context.Context, req *PayoutRequest, params PayoutsPostParams) (r PayoutsPostRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// PayoutsSearchGet implements GET /payouts/search operation.
|
||||
//
|
||||
// Use this request to search for payouts by the specified criteria. Available only for payouts
|
||||
// created over the last 3 months. At this time, only search by the metadata parameter is available.
|
||||
// You can also specify the date and time when the payout was created (the created_at parameter).
|
||||
// Request authentication details: https://yookassa.ru/developers/using-api/interaction-format#auth
|
||||
// depend on which payment solution you are using: basic payouts: https://yookassa.
|
||||
// ru/developers/payouts/overview or payouts within the Safe Deal: https://yookassa.
|
||||
// ru/developers/solutions-for-platforms/safe-deal/basics.
|
||||
//
|
||||
// GET /payouts/search
|
||||
func (UnimplementedHandler) PayoutsSearchGet(ctx context.Context, params PayoutsSearchGetParams) (r PayoutsSearchGetRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// PersonalDataPersonalDataIDGet implements GET /personal_data/{personal_data_id} operation.
|
||||
//
|
||||
// С помощью этого запроса вы можете получить
|
||||
// информацию о текущем статусе объекта персональных
|
||||
// данных по его уникальному идентификатору.
|
||||
//
|
||||
// GET /personal_data/{personal_data_id}
|
||||
func (UnimplementedHandler) PersonalDataPersonalDataIDGet(ctx context.Context, params PersonalDataPersonalDataIDGetParams) (r PersonalDataPersonalDataIDGetRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// PersonalDataPost implements POST /personal_data operation.
|
||||
//
|
||||
// Используйте этот запрос, чтобы создать в ЮKassa объект
|
||||
// персональных данных: https://yookassa.ru/developers/api#personal_data_object. В
|
||||
// запросе необходимо указать тип данных (с какой целью
|
||||
// они будут использоваться) и передать информацию о
|
||||
// пользователе: фамилию, имя, отчество и другие — в
|
||||
// зависимости от выбранного типа. Идентификатор
|
||||
// созданного объекта персональных данных необходимо
|
||||
// использовать в запросе на создание выплаты: https://yookassa.
|
||||
// ru/developers/api#create_payout.
|
||||
//
|
||||
// POST /personal_data
|
||||
func (UnimplementedHandler) PersonalDataPost(ctx context.Context, req PersonalDataPostReq, params PersonalDataPostParams) (r PersonalDataPostRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// ReceiptsGet implements GET /receipts operation.
|
||||
//
|
||||
// Запрос позволяет получить список чеков,
|
||||
// отфильтрованный по заданным критериям. Можно
|
||||
// запросить чеки по конкретному платежу, чеки по
|
||||
// конкретному возврату или все чеки магазина.
|
||||
// Подробнее о работе со списками: https://yookassa.
|
||||
// ru/developers/using-api/lists.
|
||||
//
|
||||
// GET /receipts
|
||||
func (UnimplementedHandler) ReceiptsGet(ctx context.Context, params ReceiptsGetParams) (r ReceiptsGetRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// ReceiptsPost implements POST /receipts operation.
|
||||
//
|
||||
// Используйте этот запрос при оплате с соблюдением
|
||||
// требований 54-ФЗ: https://yookassa.
|
||||
// ru/developers/payment-acceptance/receipts/54fz/basics, чтобы создать чек
|
||||
// зачета предоплаты. Если вы работаете по сценарию
|
||||
// Сначала платеж, потом чек: https://yookassa.
|
||||
// ru/developers/payment-acceptance/receipts/54fz/other-services/basics#receipt-after-payment, в
|
||||
// запросе также нужно передавать данные для
|
||||
// формирования чека прихода и чека возврата прихода.
|
||||
//
|
||||
// POST /receipts
|
||||
func (UnimplementedHandler) ReceiptsPost(ctx context.Context, req PostReceiptData, params ReceiptsPostParams) (r ReceiptsPostRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// ReceiptsReceiptIDGet implements GET /receipts/{receipt_id} operation.
|
||||
//
|
||||
// Запрос позволяет получить информацию о текущем
|
||||
// состоянии чека по его уникальному идентификатору.
|
||||
//
|
||||
// GET /receipts/{receipt_id}
|
||||
func (UnimplementedHandler) ReceiptsReceiptIDGet(ctx context.Context, params ReceiptsReceiptIDGetParams) (r ReceiptsReceiptIDGetRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// RefundsGet implements GET /refunds operation.
|
||||
//
|
||||
// Use this request to get a list of refunds. You can download refunds created over the last 3 years.
|
||||
// You can filter the list by specified criteria. More about working with lists: https://yookassa.
|
||||
// ru/developers/using-api/lists.
|
||||
//
|
||||
// GET /refunds
|
||||
func (UnimplementedHandler) RefundsGet(ctx context.Context, params RefundsGetParams) (r RefundsGetRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// RefundsPost implements POST /refunds operation.
|
||||
//
|
||||
// Создает возврат успешного платежа на указанную сумму.
|
||||
//
|
||||
// Платеж можно вернуть только в течение трех лет с
|
||||
//
|
||||
// момента его создания: https://yookassa.ru/developers/api#create_payment.
|
||||
// Комиссия ЮKassa за проведение платежа не возвращается.
|
||||
//
|
||||
// POST /refunds
|
||||
func (UnimplementedHandler) RefundsPost(ctx context.Context, req *RefundsPostReq, params RefundsPostParams) (r RefundsPostRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// RefundsRefundIDGet implements GET /refunds/{refund_id} operation.
|
||||
//
|
||||
// Запрос позволяет получить информацию о текущем
|
||||
// состоянии возврата по его уникальному
|
||||
// идентификатору.
|
||||
//
|
||||
// GET /refunds/{refund_id}
|
||||
func (UnimplementedHandler) RefundsRefundIDGet(ctx context.Context, params RefundsRefundIDGetParams) (r RefundsRefundIDGetRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// SbpBanksGet implements GET /sbp_banks operation.
|
||||
//
|
||||
// С помощью этого запроса вы можете получить
|
||||
// актуальный список всех участников СБП. Список нужно
|
||||
// вывести получателю выплаты, идентификатор
|
||||
// выбранного участника СБП необходимо использовать в
|
||||
// запросе на создание выплаты: https://yookassa.
|
||||
// ru/developers/api#create_payout. Подробнее о выплатах через СБП:
|
||||
// https://yookassa.ru/developers/payouts/making-payouts/sbp.
|
||||
//
|
||||
// GET /sbp_banks
|
||||
func (UnimplementedHandler) SbpBanksGet(ctx context.Context) (r SbpBanksGetRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// WebhooksGet implements GET /webhooks operation.
|
||||
//
|
||||
// Запрос позволяет узнать, какие webhook есть для
|
||||
// переданного OAuth-токена.
|
||||
//
|
||||
// GET /webhooks
|
||||
func (UnimplementedHandler) WebhooksGet(ctx context.Context) (r WebhooksGetRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// WebhooksPost implements POST /webhooks operation.
|
||||
//
|
||||
// Запрос позволяет подписаться на уведомления о
|
||||
// событиях: https://yookassa.ru/developers/using-api/webhooks#events (например,
|
||||
// переход платежа в статус succeeded). C помощью webhook можно
|
||||
// подписаться только на события платежей и возвратов.
|
||||
// Если вы хотите получать уведомления о нескольких
|
||||
// событиях, вам нужно для каждого из них создать свой
|
||||
// webhook. Для каждого OAuth-токена нужно создавать свой
|
||||
// набор webhook.
|
||||
//
|
||||
// POST /webhooks
|
||||
func (UnimplementedHandler) WebhooksPost(ctx context.Context, req *WebhooksPostReq, params WebhooksPostParams) (r WebhooksPostRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
|
||||
// WebhooksWebhookIDDelete implements DELETE /webhooks/{webhook_id} operation.
|
||||
//
|
||||
// Запрос позволяет отписаться от уведомлений о событии
|
||||
// для переданного OAuth-токена. Чтобы удалить webhook, вам
|
||||
// нужно передать в запросе его идентификатор.
|
||||
//
|
||||
// DELETE /webhooks/{webhook_id}
|
||||
func (UnimplementedHandler) WebhooksWebhookIDDelete(ctx context.Context, params WebhooksWebhookIDDeleteParams) (r WebhooksWebhookIDDeleteRes, _ error) {
|
||||
return r, ht.ErrNotImplemented
|
||||
}
|
||||
67
internal/service/yookassa/gen/oas_uri_gen.go
Normal file
67
internal/service/yookassa/gen/oas_uri_gen.go
Normal file
@@ -0,0 +1,67 @@
|
||||
// Code generated by ogen, DO NOT EDIT.
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
"github.com/go-faster/errors"
|
||||
"github.com/ogen-go/ogen/conv"
|
||||
"github.com/ogen-go/ogen/uri"
|
||||
"github.com/ogen-go/ogen/validate"
|
||||
)
|
||||
|
||||
// EncodeURI encodes MetadataInQueryParameter as URI form.
|
||||
func (s MetadataInQueryParameter) EncodeURI(e uri.Encoder) error {
|
||||
for k, elem := range s {
|
||||
if err := e.EncodeField(k, func(e uri.Encoder) error {
|
||||
|
||||
return e.EncodeValue(conv.StringToString(elem))
|
||||
}); err != nil {
|
||||
return errors.Wrapf(err, "encode field %q", k)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DecodeURI decodes MetadataInQueryParameter from URI form.
|
||||
func (s *MetadataInQueryParameter) DecodeURI(d uri.Decoder) error {
|
||||
if s == nil {
|
||||
return errors.New("invalid: unable to decode MetadataInQueryParameter to nil")
|
||||
}
|
||||
m := s.init()
|
||||
var propertiesCount int
|
||||
if err := d.DecodeFields(func(k string, d uri.Decoder) error {
|
||||
propertiesCount++
|
||||
var elem string
|
||||
if err := func() error {
|
||||
val, err := d.DecodeValue()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
c, err := conv.ToString(val)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
elem = c
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrapf(err, "decode field %q", k)
|
||||
}
|
||||
m[string(k)] = elem
|
||||
return nil
|
||||
}); err != nil {
|
||||
return errors.Wrap(err, "decode MetadataInQueryParameter")
|
||||
}
|
||||
// Validate properties count.
|
||||
if err := (validate.Object{
|
||||
MinProperties: 0,
|
||||
MinPropertiesSet: false,
|
||||
MaxProperties: 1,
|
||||
MaxPropertiesSet: true,
|
||||
}).ValidateProperties(propertiesCount); err != nil {
|
||||
return errors.Wrap(err, "object")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
13852
internal/service/yookassa/gen/oas_validators_gen.go
Normal file
13852
internal/service/yookassa/gen/oas_validators_gen.go
Normal file
File diff suppressed because it is too large
Load Diff
2
internal/service/yookassa/ogen.yml
Normal file
2
internal/service/yookassa/ogen.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
generator:
|
||||
ignore_not_implemented: ["all"]
|
||||
3
internal/service/yookassa/package.go
Normal file
3
internal/service/yookassa/package.go
Normal file
@@ -0,0 +1,3 @@
|
||||
package yookassa
|
||||
|
||||
//go:generate ogen --target ./gen -package gen --clean yookassa-openapi-specification.yaml
|
||||
5491
internal/service/yookassa/yookassa-openapi-specification.yaml
Normal file
5491
internal/service/yookassa/yookassa-openapi-specification.yaml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,42 @@
|
||||
package yookassa
|
||||
|
||||
import "payouts/internal/service/yookassa/config"
|
||||
import (
|
||||
"context"
|
||||
"payouts/internal/service/yookassa/config"
|
||||
"payouts/internal/service/yookassa/gen"
|
||||
|
||||
"github.com/ogen-go/ogen/ogenerrors"
|
||||
)
|
||||
|
||||
type yookassaService struct {
|
||||
conf config.YooKassa
|
||||
conf config.YooKassa
|
||||
payClient *gen.Client
|
||||
}
|
||||
|
||||
// BasicAuth implements [gen.SecuritySource].
|
||||
func (y *yookassaService) BasicAuth(ctx context.Context, operationName gen.OperationName) (gen.BasicAuth, error) {
|
||||
return gen.BasicAuth{
|
||||
Username: y.conf.ApiPaymentKey,
|
||||
Password: y.conf.ApiBaseSecret,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// OAuth2 implements [gen.SecuritySource].
|
||||
func (y *yookassaService) OAuth2(ctx context.Context, operationName gen.OperationName) (gen.OAuth2, error) {
|
||||
return gen.OAuth2{}, ogenerrors.ErrSkipClientSecurity
|
||||
}
|
||||
|
||||
func NewYookassaService(conf config.YooKassa) (Service, error) {
|
||||
return &yookassaService{
|
||||
|
||||
svc := &yookassaService{
|
||||
conf: conf,
|
||||
}, nil
|
||||
}
|
||||
payClient, err := gen.NewClient(conf.BaseUrl, svc)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
svc.payClient = payClient
|
||||
|
||||
// payClient.PaymentsPost()
|
||||
return svc, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user