Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Upgraded Kiota to 1.19.1 #5349

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go-sdk/go-sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.OpenApi.Kiota.Builder" Version="1.18.0" />
<PackageReference Include="Microsoft.OpenApi.Kiota.Builder" Version="1.19.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package ids

import (
"context"
i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543 "github.com/apicurio/apicurio-registry/go-sdk/pkg/registryclient-v2/models"
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
)

// ContentHashesItemWithContentHashRequestBuilder access artifact content utilizing the SHA-256 hash of the content.
type ContentHashesItemWithContentHashRequestBuilder struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}

// ContentHashesItemWithContentHashRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options.
type ContentHashesItemWithContentHashRequestBuilderGetRequestConfiguration struct {
// Request headers
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders
// Request options
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption
}

// NewContentHashesItemWithContentHashRequestBuilderInternal instantiates a new ContentHashesItemWithContentHashRequestBuilder and sets the default values.
func NewContentHashesItemWithContentHashRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, contentHash *string) *ContentHashesItemWithContentHashRequestBuilder {
m := &ContentHashesItemWithContentHashRequestBuilder{
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/ids/contentHashes/{contentHash}/", pathParameters),
}
if contentHash != nil {
m.BaseRequestBuilder.PathParameters["contentHash"] = *contentHash
}
return m
}

// NewContentHashesItemWithContentHashRequestBuilder instantiates a new ContentHashesItemWithContentHashRequestBuilder and sets the default values.
func NewContentHashesItemWithContentHashRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentHashesItemWithContentHashRequestBuilder {
urlParams := make(map[string]string)
urlParams["request-raw-url"] = rawUrl
return NewContentHashesItemWithContentHashRequestBuilderInternal(urlParams, requestAdapter, nil)
}

// 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`)
// returns a []byte when successful
// returns a Error error when the service returns a 404 status code
// returns a Error error when the service returns a 500 status code
func (m *ContentHashesItemWithContentHashRequestBuilder) Get(ctx context.Context, requestConfiguration *ContentHashesItemWithContentHashRequestBuilderGetRequestConfiguration) ([]byte, error) {
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration)
if err != nil {
return nil, err
}
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{
"404": i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543.CreateErrorFromDiscriminatorValue,
"500": i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543.CreateErrorFromDiscriminatorValue,
}
res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", errorMapping)
if err != nil {
return nil, err
}
if res == nil {
return nil, nil
}
return res.([]byte), nil
}

// 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`)
// returns a *RequestInformation when successful
func (m *ContentHashesItemWithContentHashRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ContentHashesItemWithContentHashRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters)
if requestConfiguration != nil {
requestInfo.Headers.AddAll(requestConfiguration.Headers)
requestInfo.AddRequestOptions(requestConfiguration.Options)
}
requestInfo.Headers.TryAdd("Accept", "*/*, application/json")
return requestInfo, nil
}

// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
// returns a *ContentHashesItemWithContentHashRequestBuilder when successful
func (m *ContentHashesItemWithContentHashRequestBuilder) WithUrl(rawUrl string) *ContentHashesItemWithContentHashRequestBuilder {
return NewContentHashesItemWithContentHashRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter)
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type ContentHashesRequestBuilder struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}

// ByContentHash access artifact content utilizing the SHA-256 hash of the content.
// ByContentHash gets an item from the github.com/apicurio/apicurio-registry/go-sdk/pkg/registryclient-v2.ids.contentHashes.item collection
// returns a *ContentHashesWithContentHashItemRequestBuilder when successful
func (m *ContentHashesRequestBuilder) ByContentHash(contentHash string) *ContentHashesWithContentHashItemRequestBuilder {
urlTplParams := make(map[string]string)
Expand All @@ -36,3 +36,9 @@ func NewContentHashesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee
urlParams["request-raw-url"] = rawUrl
return NewContentHashesRequestBuilderInternal(urlParams, requestAdapter)
}

// WithContentHash access artifact content utilizing the SHA-256 hash of the content.
// returns a *ContentHashesItemWithContentHashRequestBuilder when successful
func (m *ContentHashesRequestBuilder) WithContentHash(contentHash *string) *ContentHashesItemWithContentHashRequestBuilder {
return NewContentHashesItemWithContentHashRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter, contentHash)
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
package ids

import (
"context"
i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543 "github.com/apicurio/apicurio-registry/go-sdk/pkg/registryclient-v2/models"
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
)

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

// ContentHashesWithContentHashItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options.
type ContentHashesWithContentHashItemRequestBuilderGetRequestConfiguration struct {
// Request headers
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders
// Request options
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption
}

// NewContentHashesWithContentHashItemRequestBuilderInternal instantiates a new ContentHashesWithContentHashItemRequestBuilder and sets the default values.
func NewContentHashesWithContentHashItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentHashesWithContentHashItemRequestBuilder {
m := &ContentHashesWithContentHashItemRequestBuilder{
Expand All @@ -34,49 +24,8 @@ func NewContentHashesWithContentHashItemRequestBuilder(rawUrl string, requestAda
return NewContentHashesWithContentHashItemRequestBuilderInternal(urlParams, requestAdapter)
}

// 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`)
// returns a []byte when successful
// returns a Error error when the service returns a 404 status code
// returns a Error error when the service returns a 500 status code
func (m *ContentHashesWithContentHashItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ContentHashesWithContentHashItemRequestBuilderGetRequestConfiguration) ([]byte, error) {
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration)
if err != nil {
return nil, err
}
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{
"404": i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543.CreateErrorFromDiscriminatorValue,
"500": i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543.CreateErrorFromDiscriminatorValue,
}
res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", errorMapping)
if err != nil {
return nil, err
}
if res == nil {
return nil, nil
}
return res.([]byte), nil
}

// References the references property
// returns a *ContentHashesItemReferencesRequestBuilder when successful
func (m *ContentHashesWithContentHashItemRequestBuilder) References() *ContentHashesItemReferencesRequestBuilder {
return NewContentHashesItemReferencesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter)
}

// 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`)
// returns a *RequestInformation when successful
func (m *ContentHashesWithContentHashItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ContentHashesWithContentHashItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters)
if requestConfiguration != nil {
requestInfo.Headers.AddAll(requestConfiguration.Headers)
requestInfo.AddRequestOptions(requestConfiguration.Options)
}
requestInfo.Headers.TryAdd("Accept", "*/*, application/json")
return requestInfo, nil
}

// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
// returns a *ContentHashesWithContentHashItemRequestBuilder when successful
func (m *ContentHashesWithContentHashItemRequestBuilder) WithUrl(rawUrl string) *ContentHashesWithContentHashItemRequestBuilder {
return NewContentHashesWithContentHashItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package ids

import (
"context"
i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543 "github.com/apicurio/apicurio-registry/go-sdk/pkg/registryclient-v2/models"
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv"
)

// ContentIdsItemWithContentIdRequestBuilder access artifact content utilizing the unique content identifier for that content.
type ContentIdsItemWithContentIdRequestBuilder struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}

// ContentIdsItemWithContentIdRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options.
type ContentIdsItemWithContentIdRequestBuilderGetRequestConfiguration struct {
// Request headers
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders
// Request options
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption
}

// NewContentIdsItemWithContentIdRequestBuilderInternal instantiates a new ContentIdsItemWithContentIdRequestBuilder and sets the default values.
func NewContentIdsItemWithContentIdRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, contentId *int64) *ContentIdsItemWithContentIdRequestBuilder {
m := &ContentIdsItemWithContentIdRequestBuilder{
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/ids/contentIds/{contentId}/", pathParameters),
}
if contentId != nil {
m.BaseRequestBuilder.PathParameters["contentId"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(*contentId, 10)
}
return m
}

// NewContentIdsItemWithContentIdRequestBuilder instantiates a new ContentIdsItemWithContentIdRequestBuilder and sets the default values.
func NewContentIdsItemWithContentIdRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentIdsItemWithContentIdRequestBuilder {
urlParams := make(map[string]string)
urlParams["request-raw-url"] = rawUrl
return NewContentIdsItemWithContentIdRequestBuilderInternal(urlParams, requestAdapter, nil)
}

// 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`)
// returns a []byte when successful
// returns a Error error when the service returns a 404 status code
// returns a Error error when the service returns a 500 status code
func (m *ContentIdsItemWithContentIdRequestBuilder) Get(ctx context.Context, requestConfiguration *ContentIdsItemWithContentIdRequestBuilderGetRequestConfiguration) ([]byte, error) {
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration)
if err != nil {
return nil, err
}
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{
"404": i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543.CreateErrorFromDiscriminatorValue,
"500": i80228d093fd3b582ec81b86f113cc707692a60cdd08bae7a390086a8438c7543.CreateErrorFromDiscriminatorValue,
}
res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", errorMapping)
if err != nil {
return nil, err
}
if res == nil {
return nil, nil
}
return res.([]byte), nil
}

// 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`)
// returns a *RequestInformation when successful
func (m *ContentIdsItemWithContentIdRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ContentIdsItemWithContentIdRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters)
if requestConfiguration != nil {
requestInfo.Headers.AddAll(requestConfiguration.Headers)
requestInfo.AddRequestOptions(requestConfiguration.Options)
}
requestInfo.Headers.TryAdd("Accept", "*/*, application/json")
return requestInfo, nil
}

// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
// returns a *ContentIdsItemWithContentIdRequestBuilder when successful
func (m *ContentIdsItemWithContentIdRequestBuilder) WithUrl(rawUrl string) *ContentIdsItemWithContentIdRequestBuilder {
return NewContentIdsItemWithContentIdRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter)
}
10 changes: 8 additions & 2 deletions go-sdk/pkg/registryclient-v2/ids/content_ids_request_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type ContentIdsRequestBuilder struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}

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

// ByContentIdInt64 access artifact content utilizing the unique content identifier for that content.
// ByContentIdInt64 gets an item from the github.com/apicurio/apicurio-registry/go-sdk/pkg/registryclient-v2.ids.contentIds.item collection
// returns a *ContentIdsWithContentItemRequestBuilder when successful
func (m *ContentIdsRequestBuilder) ByContentIdInt64(contentId int64) *ContentIdsWithContentItemRequestBuilder {
urlTplParams := make(map[string]string)
Expand All @@ -49,3 +49,9 @@ func NewContentIdsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263
urlParams["request-raw-url"] = rawUrl
return NewContentIdsRequestBuilderInternal(urlParams, requestAdapter)
}

// WithContentId access artifact content utilizing the unique content identifier for that content.
// returns a *ContentIdsItemWithContentIdRequestBuilder when successful
func (m *ContentIdsRequestBuilder) WithContentId(contentId *int64) *ContentIdsItemWithContentIdRequestBuilder {
return NewContentIdsItemWithContentIdRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter, contentId)
}
Loading
Loading