Skip to content

Commit 8866dba

Browse files
authored
Upgraded Kiota to 1.19.1 (#5349)
1 parent a7ee326 commit 8866dba

16 files changed

+260
-189
lines changed

go-sdk/go-sdk.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.OpenApi.Kiota.Builder" Version="1.18.0" />
9+
<PackageReference Include="Microsoft.OpenApi.Kiota.Builder" Version="1.19.1" />
1010
</ItemGroup>
1111

1212
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
package ids
2+
3+
import (
4+
"context"
5+
i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543 "github.com/apicurio/apicurio-registry/go-sdk/pkg/registryclient-v2/models"
6+
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
7+
)
8+
9+
// ContentHashesItemWithContentHashRequestBuilder access artifact content utilizing the SHA-256 hash of the content.
10+
type ContentHashesItemWithContentHashRequestBuilder struct {
11+
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
12+
}
13+
14+
// ContentHashesItemWithContentHashRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options.
15+
type ContentHashesItemWithContentHashRequestBuilderGetRequestConfiguration struct {
16+
// Request headers
17+
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders
18+
// Request options
19+
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption
20+
}
21+
22+
// NewContentHashesItemWithContentHashRequestBuilderInternal instantiates a new ContentHashesItemWithContentHashRequestBuilder and sets the default values.
23+
func NewContentHashesItemWithContentHashRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, contentHash *string) *ContentHashesItemWithContentHashRequestBuilder {
24+
m := &ContentHashesItemWithContentHashRequestBuilder{
25+
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/ids/contentHashes/{contentHash}/", pathParameters),
26+
}
27+
if contentHash != nil {
28+
m.BaseRequestBuilder.PathParameters["contentHash"] = *contentHash
29+
}
30+
return m
31+
}
32+
33+
// NewContentHashesItemWithContentHashRequestBuilder instantiates a new ContentHashesItemWithContentHashRequestBuilder and sets the default values.
34+
func NewContentHashesItemWithContentHashRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentHashesItemWithContentHashRequestBuilder {
35+
urlParams := make(map[string]string)
36+
urlParams["request-raw-url"] = rawUrl
37+
return NewContentHashesItemWithContentHashRequestBuilderInternal(urlParams, requestAdapter, nil)
38+
}
39+
40+
// Get gets the content for an artifact version in the registry using the SHA-256 hash of the content. This content hash may be shared by multiple artifactversions in the case where the artifact versions have identical content.This operation may fail for one of the following reasons:* No content with this `contentHash` exists (HTTP error `404`)* A server error occurred (HTTP error `500`)
41+
// returns a []byte when successful
42+
// returns a Error error when the service returns a 404 status code
43+
// returns a Error error when the service returns a 500 status code
44+
func (m *ContentHashesItemWithContentHashRequestBuilder) Get(ctx context.Context, requestConfiguration *ContentHashesItemWithContentHashRequestBuilderGetRequestConfiguration) ([]byte, error) {
45+
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration)
46+
if err != nil {
47+
return nil, err
48+
}
49+
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{
50+
"404": i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543.CreateErrorFromDiscriminatorValue,
51+
"500": i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543.CreateErrorFromDiscriminatorValue,
52+
}
53+
res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", errorMapping)
54+
if err != nil {
55+
return nil, err
56+
}
57+
if res == nil {
58+
return nil, nil
59+
}
60+
return res.([]byte), nil
61+
}
62+
63+
// ToGetRequestInformation gets the content for an artifact version in the registry using the SHA-256 hash of the content. This content hash may be shared by multiple artifactversions in the case where the artifact versions have identical content.This operation may fail for one of the following reasons:* No content with this `contentHash` exists (HTTP error `404`)* A server error occurred (HTTP error `500`)
64+
// returns a *RequestInformation when successful
65+
func (m *ContentHashesItemWithContentHashRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ContentHashesItemWithContentHashRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
66+
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters)
67+
if requestConfiguration != nil {
68+
requestInfo.Headers.AddAll(requestConfiguration.Headers)
69+
requestInfo.AddRequestOptions(requestConfiguration.Options)
70+
}
71+
requestInfo.Headers.TryAdd("Accept", "*/*, application/json")
72+
return requestInfo, nil
73+
}
74+
75+
// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
76+
// returns a *ContentHashesItemWithContentHashRequestBuilder when successful
77+
func (m *ContentHashesItemWithContentHashRequestBuilder) WithUrl(rawUrl string) *ContentHashesItemWithContentHashRequestBuilder {
78+
return NewContentHashesItemWithContentHashRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter)
79+
}

go-sdk/pkg/registryclient-v2/ids/content_hashes_request_builder.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type ContentHashesRequestBuilder struct {
99
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
1010
}
1111

12-
// ByContentHash access artifact content utilizing the SHA-256 hash of the content.
12+
// ByContentHash gets an item from the github.com/apicurio/apicurio-registry/go-sdk/pkg/registryclient-v2.ids.contentHashes.item collection
1313
// returns a *ContentHashesWithContentHashItemRequestBuilder when successful
1414
func (m *ContentHashesRequestBuilder) ByContentHash(contentHash string) *ContentHashesWithContentHashItemRequestBuilder {
1515
urlTplParams := make(map[string]string)
@@ -36,3 +36,9 @@ func NewContentHashesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee
3636
urlParams["request-raw-url"] = rawUrl
3737
return NewContentHashesRequestBuilderInternal(urlParams, requestAdapter)
3838
}
39+
40+
// WithContentHash access artifact content utilizing the SHA-256 hash of the content.
41+
// returns a *ContentHashesItemWithContentHashRequestBuilder when successful
42+
func (m *ContentHashesRequestBuilder) WithContentHash(contentHash *string) *ContentHashesItemWithContentHashRequestBuilder {
43+
return NewContentHashesItemWithContentHashRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter, contentHash)
44+
}
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
11
package ids
22

33
import (
4-
"context"
5-
i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543 "github.com/apicurio/apicurio-registry/go-sdk/pkg/registryclient-v2/models"
64
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
75
)
86

9-
// ContentHashesWithContentHashItemRequestBuilder access artifact content utilizing the SHA-256 hash of the content.
7+
// ContentHashesWithContentHashItemRequestBuilder builds and executes requests for operations under \ids\contentHashes\{contentHash}
108
type ContentHashesWithContentHashItemRequestBuilder struct {
119
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
1210
}
1311

14-
// ContentHashesWithContentHashItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options.
15-
type ContentHashesWithContentHashItemRequestBuilderGetRequestConfiguration struct {
16-
// Request headers
17-
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders
18-
// Request options
19-
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption
20-
}
21-
2212
// NewContentHashesWithContentHashItemRequestBuilderInternal instantiates a new ContentHashesWithContentHashItemRequestBuilder and sets the default values.
2313
func NewContentHashesWithContentHashItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentHashesWithContentHashItemRequestBuilder {
2414
m := &ContentHashesWithContentHashItemRequestBuilder{
@@ -34,49 +24,8 @@ func NewContentHashesWithContentHashItemRequestBuilder(rawUrl string, requestAda
3424
return NewContentHashesWithContentHashItemRequestBuilderInternal(urlParams, requestAdapter)
3525
}
3626

37-
// Get gets the content for an artifact version in the registry using the SHA-256 hash of the content. This content hash may be shared by multiple artifactversions in the case where the artifact versions have identical content.This operation may fail for one of the following reasons:* No content with this `contentHash` exists (HTTP error `404`)* A server error occurred (HTTP error `500`)
38-
// returns a []byte when successful
39-
// returns a Error error when the service returns a 404 status code
40-
// returns a Error error when the service returns a 500 status code
41-
func (m *ContentHashesWithContentHashItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ContentHashesWithContentHashItemRequestBuilderGetRequestConfiguration) ([]byte, error) {
42-
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration)
43-
if err != nil {
44-
return nil, err
45-
}
46-
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{
47-
"404": i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543.CreateErrorFromDiscriminatorValue,
48-
"500": i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543.CreateErrorFromDiscriminatorValue,
49-
}
50-
res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", errorMapping)
51-
if err != nil {
52-
return nil, err
53-
}
54-
if res == nil {
55-
return nil, nil
56-
}
57-
return res.([]byte), nil
58-
}
59-
6027
// References the references property
6128
// returns a *ContentHashesItemReferencesRequestBuilder when successful
6229
func (m *ContentHashesWithContentHashItemRequestBuilder) References() *ContentHashesItemReferencesRequestBuilder {
6330
return NewContentHashesItemReferencesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter)
6431
}
65-
66-
// ToGetRequestInformation gets the content for an artifact version in the registry using the SHA-256 hash of the content. This content hash may be shared by multiple artifactversions in the case where the artifact versions have identical content.This operation may fail for one of the following reasons:* No content with this `contentHash` exists (HTTP error `404`)* A server error occurred (HTTP error `500`)
67-
// returns a *RequestInformation when successful
68-
func (m *ContentHashesWithContentHashItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ContentHashesWithContentHashItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
69-
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters)
70-
if requestConfiguration != nil {
71-
requestInfo.Headers.AddAll(requestConfiguration.Headers)
72-
requestInfo.AddRequestOptions(requestConfiguration.Options)
73-
}
74-
requestInfo.Headers.TryAdd("Accept", "*/*, application/json")
75-
return requestInfo, nil
76-
}
77-
78-
// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
79-
// returns a *ContentHashesWithContentHashItemRequestBuilder when successful
80-
func (m *ContentHashesWithContentHashItemRequestBuilder) WithUrl(rawUrl string) *ContentHashesWithContentHashItemRequestBuilder {
81-
return NewContentHashesWithContentHashItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter)
82-
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
package ids
2+
3+
import (
4+
"context"
5+
i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543 "github.com/apicurio/apicurio-registry/go-sdk/pkg/registryclient-v2/models"
6+
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
7+
i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv"
8+
)
9+
10+
// ContentIdsItemWithContentIdRequestBuilder access artifact content utilizing the unique content identifier for that content.
11+
type ContentIdsItemWithContentIdRequestBuilder struct {
12+
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
13+
}
14+
15+
// ContentIdsItemWithContentIdRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options.
16+
type ContentIdsItemWithContentIdRequestBuilderGetRequestConfiguration struct {
17+
// Request headers
18+
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders
19+
// Request options
20+
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption
21+
}
22+
23+
// NewContentIdsItemWithContentIdRequestBuilderInternal instantiates a new ContentIdsItemWithContentIdRequestBuilder and sets the default values.
24+
func NewContentIdsItemWithContentIdRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, contentId *int64) *ContentIdsItemWithContentIdRequestBuilder {
25+
m := &ContentIdsItemWithContentIdRequestBuilder{
26+
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/ids/contentIds/{contentId}/", pathParameters),
27+
}
28+
if contentId != nil {
29+
m.BaseRequestBuilder.PathParameters["contentId"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(*contentId, 10)
30+
}
31+
return m
32+
}
33+
34+
// NewContentIdsItemWithContentIdRequestBuilder instantiates a new ContentIdsItemWithContentIdRequestBuilder and sets the default values.
35+
func NewContentIdsItemWithContentIdRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentIdsItemWithContentIdRequestBuilder {
36+
urlParams := make(map[string]string)
37+
urlParams["request-raw-url"] = rawUrl
38+
return NewContentIdsItemWithContentIdRequestBuilderInternal(urlParams, requestAdapter, nil)
39+
}
40+
41+
// Get gets the content for an artifact version in the registry using the unique contentidentifier for that content. This content ID may be shared by multiple artifactversions in the case where the artifact versions are identical.This operation may fail for one of the following reasons:* No content with this `contentId` exists (HTTP error `404`)* A server error occurred (HTTP error `500`)
42+
// returns a []byte when successful
43+
// returns a Error error when the service returns a 404 status code
44+
// returns a Error error when the service returns a 500 status code
45+
func (m *ContentIdsItemWithContentIdRequestBuilder) Get(ctx context.Context, requestConfiguration *ContentIdsItemWithContentIdRequestBuilderGetRequestConfiguration) ([]byte, error) {
46+
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration)
47+
if err != nil {
48+
return nil, err
49+
}
50+
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{
51+
"404": i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543.CreateErrorFromDiscriminatorValue,
52+
"500": i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543.CreateErrorFromDiscriminatorValue,
53+
}
54+
res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", errorMapping)
55+
if err != nil {
56+
return nil, err
57+
}
58+
if res == nil {
59+
return nil, nil
60+
}
61+
return res.([]byte), nil
62+
}
63+
64+
// ToGetRequestInformation gets the content for an artifact version in the registry using the unique contentidentifier for that content. This content ID may be shared by multiple artifactversions in the case where the artifact versions are identical.This operation may fail for one of the following reasons:* No content with this `contentId` exists (HTTP error `404`)* A server error occurred (HTTP error `500`)
65+
// returns a *RequestInformation when successful
66+
func (m *ContentIdsItemWithContentIdRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ContentIdsItemWithContentIdRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
67+
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters)
68+
if requestConfiguration != nil {
69+
requestInfo.Headers.AddAll(requestConfiguration.Headers)
70+
requestInfo.AddRequestOptions(requestConfiguration.Options)
71+
}
72+
requestInfo.Headers.TryAdd("Accept", "*/*, application/json")
73+
return requestInfo, nil
74+
}
75+
76+
// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
77+
// returns a *ContentIdsItemWithContentIdRequestBuilder when successful
78+
func (m *ContentIdsItemWithContentIdRequestBuilder) WithUrl(rawUrl string) *ContentIdsItemWithContentIdRequestBuilder {
79+
return NewContentIdsItemWithContentIdRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter)
80+
}

go-sdk/pkg/registryclient-v2/ids/content_ids_request_builder.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type ContentIdsRequestBuilder struct {
1010
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
1111
}
1212

13-
// ByContentId access artifact content utilizing the unique content identifier for that content.
13+
// ByContentId gets an item from the github.com/apicurio/apicurio-registry/go-sdk/pkg/registryclient-v2.ids.contentIds.item collection
1414
// Deprecated: This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.
1515
// returns a *ContentIdsWithContentItemRequestBuilder when successful
1616
func (m *ContentIdsRequestBuilder) ByContentId(contentId string) *ContentIdsWithContentItemRequestBuilder {
@@ -24,7 +24,7 @@ func (m *ContentIdsRequestBuilder) ByContentId(contentId string) *ContentIdsWith
2424
return NewContentIdsWithContentItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter)
2525
}
2626

27-
// ByContentIdInt64 access artifact content utilizing the unique content identifier for that content.
27+
// ByContentIdInt64 gets an item from the github.com/apicurio/apicurio-registry/go-sdk/pkg/registryclient-v2.ids.contentIds.item collection
2828
// returns a *ContentIdsWithContentItemRequestBuilder when successful
2929
func (m *ContentIdsRequestBuilder) ByContentIdInt64(contentId int64) *ContentIdsWithContentItemRequestBuilder {
3030
urlTplParams := make(map[string]string)
@@ -49,3 +49,9 @@ func NewContentIdsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263
4949
urlParams["request-raw-url"] = rawUrl
5050
return NewContentIdsRequestBuilderInternal(urlParams, requestAdapter)
5151
}
52+
53+
// WithContentId access artifact content utilizing the unique content identifier for that content.
54+
// returns a *ContentIdsItemWithContentIdRequestBuilder when successful
55+
func (m *ContentIdsRequestBuilder) WithContentId(contentId *int64) *ContentIdsItemWithContentIdRequestBuilder {
56+
return NewContentIdsItemWithContentIdRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter, contentId)
57+
}

0 commit comments

Comments
 (0)