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

Bump kiota from 1.18.0 to 1.19.1 #17

Merged
merged 1 commit into from
Oct 17, 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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ examplemocks: $(MOCKGEN)

.PHONY: ssclient
ssclient:
@which kiota > /dev/null 2>&1 || (echo "kiota not found in PATH, download v1.18.0 from: https://learn.microsoft.com/en-ca/openapi/kiota/install" && exit 1)
@which kiota > /dev/null 2>&1 || (echo "kiota not found in PATH, download v1.19.1 from: https://learn.microsoft.com/en-ca/openapi/kiota/install" && exit 1)
kiota generate --language go --clean-output --class-name Client --namespace-name go.artefactual.dev/ssclient/kiota --openapi typespec/tsp-output/@typespec/openapi3/openapi.v1.yaml --output ./kiota

.PHONY: typespec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,35 @@ import (
ia31f303b98dc4e7292d1559872ed38681eda57e78e48a431654df5b787bc8588 "go.artefactual.dev/ssclient/kiota/models"
)

// V2LocationDefaultWithPurposeItemRequestBuilder builds and executes requests for operations under \api\v2\location\default\{purpose}
type V2LocationDefaultWithPurposeItemRequestBuilder struct {
// V2LocationDefaultItemWithPurposeRequestBuilder builds and executes requests for operations under \api\v2\location\default\{purpose}\
type V2LocationDefaultItemWithPurposeRequestBuilder struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}
// V2LocationDefaultWithPurposeItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options.
type V2LocationDefaultWithPurposeItemRequestBuilderGetRequestConfiguration struct {
// V2LocationDefaultItemWithPurposeRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options.
type V2LocationDefaultItemWithPurposeRequestBuilderGetRequestConfiguration struct {
// Request headers
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders
// Request options
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption
}
// NewV2LocationDefaultWithPurposeItemRequestBuilderInternal instantiates a new V2LocationDefaultWithPurposeItemRequestBuilder and sets the default values.
func NewV2LocationDefaultWithPurposeItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2LocationDefaultWithPurposeItemRequestBuilder) {
m := &V2LocationDefaultWithPurposeItemRequestBuilder{
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/api/v2/location/default/{purpose}", pathParameters),
// NewV2LocationDefaultItemWithPurposeRequestBuilderInternal instantiates a new V2LocationDefaultItemWithPurposeRequestBuilder and sets the default values.
func NewV2LocationDefaultItemWithPurposeRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, purpose *string)(*V2LocationDefaultItemWithPurposeRequestBuilder) {
m := &V2LocationDefaultItemWithPurposeRequestBuilder{
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/api/v2/location/default/{purpose}/", pathParameters),
}
if purpose != nil {
m.BaseRequestBuilder.PathParameters["purpose"] = *purpose
}
return m
}
// NewV2LocationDefaultWithPurposeItemRequestBuilder instantiates a new V2LocationDefaultWithPurposeItemRequestBuilder and sets the default values.
func NewV2LocationDefaultWithPurposeItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2LocationDefaultWithPurposeItemRequestBuilder) {
// NewV2LocationDefaultItemWithPurposeRequestBuilder instantiates a new V2LocationDefaultItemWithPurposeRequestBuilder and sets the default values.
func NewV2LocationDefaultItemWithPurposeRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2LocationDefaultItemWithPurposeRequestBuilder) {
urlParams := make(map[string]string)
urlParams["request-raw-url"] = rawUrl
return NewV2LocationDefaultWithPurposeItemRequestBuilderInternal(urlParams, requestAdapter)
return NewV2LocationDefaultItemWithPurposeRequestBuilderInternal(urlParams, requestAdapter, nil)
}
// returns a ErrorEscaped error when the service returns a 400 status code
func (m *V2LocationDefaultWithPurposeItemRequestBuilder) Get(ctx context.Context, requestConfiguration *V2LocationDefaultWithPurposeItemRequestBuilderGetRequestConfiguration)(error) {
func (m *V2LocationDefaultItemWithPurposeRequestBuilder) Get(ctx context.Context, requestConfiguration *V2LocationDefaultItemWithPurposeRequestBuilderGetRequestConfiguration)(error) {
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);
if err != nil {
return err
Expand All @@ -46,7 +49,7 @@ func (m *V2LocationDefaultWithPurposeItemRequestBuilder) Get(ctx context.Context
return nil
}
// returns a *RequestInformation when successful
func (m *V2LocationDefaultWithPurposeItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *V2LocationDefaultWithPurposeItemRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
func (m *V2LocationDefaultItemWithPurposeRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *V2LocationDefaultItemWithPurposeRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters)
if requestConfiguration != nil {
requestInfo.Headers.AddAll(requestConfiguration.Headers)
Expand All @@ -56,7 +59,7 @@ func (m *V2LocationDefaultWithPurposeItemRequestBuilder) ToGetRequestInformation
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 *V2LocationDefaultWithPurposeItemRequestBuilder when successful
func (m *V2LocationDefaultWithPurposeItemRequestBuilder) WithUrl(rawUrl string)(*V2LocationDefaultWithPurposeItemRequestBuilder) {
return NewV2LocationDefaultWithPurposeItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter);
// returns a *V2LocationDefaultItemWithPurposeRequestBuilder when successful
func (m *V2LocationDefaultItemWithPurposeRequestBuilder) WithUrl(rawUrl string)(*V2LocationDefaultItemWithPurposeRequestBuilder) {
return NewV2LocationDefaultItemWithPurposeRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter);
}
17 changes: 5 additions & 12 deletions kiota/api/v2_location_default_request_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,6 @@ import (
type V2LocationDefaultRequestBuilder struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}
// ByPurpose gets an item from the go.artefactual.dev/ssclient/kiota.api.v2.location.default.item collection
// returns a *V2LocationDefaultWithPurposeItemRequestBuilder when successful
func (m *V2LocationDefaultRequestBuilder) ByPurpose(purpose string)(*V2LocationDefaultWithPurposeItemRequestBuilder) {
urlTplParams := make(map[string]string)
for idx, item := range m.BaseRequestBuilder.PathParameters {
urlTplParams[idx] = item
}
if purpose != "" {
urlTplParams["purpose"] = purpose
}
return NewV2LocationDefaultWithPurposeItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter)
}
// NewV2LocationDefaultRequestBuilderInternal instantiates a new V2LocationDefaultRequestBuilder and sets the default values.
func NewV2LocationDefaultRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2LocationDefaultRequestBuilder) {
m := &V2LocationDefaultRequestBuilder{
Expand All @@ -33,3 +21,8 @@ func NewV2LocationDefaultRequestBuilder(rawUrl string, requestAdapter i2ae4187f7
urlParams["request-raw-url"] = rawUrl
return NewV2LocationDefaultRequestBuilderInternal(urlParams, requestAdapter)
}
// WithPurpose builds and executes requests for operations under \api\v2\location\default\{purpose}\
// returns a *V2LocationDefaultItemWithPurposeRequestBuilder when successful
func (m *V2LocationDefaultRequestBuilder) WithPurpose(purpose *string)(*V2LocationDefaultItemWithPurposeRequestBuilder) {
return NewV2LocationDefaultItemWithPurposeRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter, purpose)
}
2 changes: 1 addition & 1 deletion kiota/api/v2_location_request_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (m *V2LocationRequestBuilder) ByUuid(uuid string)(*V2LocationWithUuItemRequ
// NewV2LocationRequestBuilderInternal instantiates a new V2LocationRequestBuilder and sets the default values.
func NewV2LocationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2LocationRequestBuilder) {
m := &V2LocationRequestBuilder{
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/api/v2/location{?description,limit,offset,order_by,pipeline__uuid,purpose,quota,relative_path,used,uuid}", pathParameters),
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/api/v2/location/{?description,limit,offset,order_by,pipeline__uuid,purpose,quota,relative_path,used,uuid}", pathParameters),
}
return m
}
Expand Down
2 changes: 1 addition & 1 deletion kiota/api/v2_pipeline_request_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (m *V2PipelineRequestBuilder) ByUuid(uuid string)(*V2PipelineWithUuItemRequ
// NewV2PipelineRequestBuilderInternal instantiates a new V2PipelineRequestBuilder and sets the default values.
func NewV2PipelineRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2PipelineRequestBuilder) {
m := &V2PipelineRequestBuilder{
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/api/v2/pipeline{?description,uuid}", pathParameters),
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/api/v2/pipeline/{?description,uuid}", pathParameters),
}
return m
}
Expand Down
3 changes: 2 additions & 1 deletion kiota/kiota-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"descriptionHash": "282F5F42C995332838196A181E9B402A3180FC6596F46BA799E25AF9DB27EE513613C3CACEFF10B58476C1E8FD12C36A028CFEF368A3B87134A297E3C82CB1D7",
"descriptionLocation": "../typespec/tsp-output/@typespec/openapi3/openapi.v1.yaml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.18.0",
"kiotaVersion": "1.19.1",
"clientClassName": "Client",
"typeAccessModifier": "Public",
"clientNamespaceName": "go.artefactual.dev/ssclient/kiota",
"language": "Go",
"usesBackingStore": false,
Expand Down
18 changes: 0 additions & 18 deletions ssclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"net/http"
"strings"
"time"

kabs "github.com/microsoft/kiota-abstractions-go"
Expand Down Expand Up @@ -65,9 +64,6 @@ func configureMiddleware(client *http.Client) error {
return err
}

// Introduce our middleware to inject the trailing slash.
middlewares = append(middlewares, appendTrailingSlashHandler{})

client.Transport = khttp.NewCustomTransportWithParentTransport(client.Transport, middlewares...)

return nil
Expand All @@ -90,17 +86,3 @@ func (p *authProvider) AuthenticateRequest(ctx context.Context, request *kabs.Re

return nil
}

// appendTrailingSlashHandler is a middleware that ensures that the path has a
// trailing slash which is the expected in Archivematica Storage Service API.
// With TypeSpec we can sucessfully describe paths with a trailing slash, but
// Kiota drops it during generation (issue #4291).
type appendTrailingSlashHandler struct{}

func (middleware appendTrailingSlashHandler) Intercept(pipeline khttp.Pipeline, middlewareIndex int, req *http.Request) (*http.Response, error) {
if !strings.HasSuffix(req.URL.Path, "/") {
req.URL.Path += "/"
}

return pipeline.Next(req, middlewareIndex)
}
Loading