ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.204.1

This commit is contained in:
speakeasybot
2024-03-08 00:44:04 +00:00
parent 992291fe20
commit 417454ebb2
39 changed files with 821 additions and 706 deletions

54
log.go
View File

@@ -32,6 +32,7 @@ func (s *Log) LogLine(ctx context.Context, level operations.Level, message strin
hookCtx := hooks.HookContext{
Context: ctx,
OperationID: "logLine",
OAuth2Scopes: []string{},
SecuritySource: s.sdkConfiguration.Security,
}
@@ -58,14 +59,16 @@ func (s *Log) LogLine(ctx context.Context, level operations.Level, message strin
return nil, fmt.Errorf("error populating query params: %w", err)
}
client := s.sdkConfiguration.SecurityClient
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
return nil, err
}
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
if err != nil {
return nil, err
}
httpRes, err := client.Do(req)
httpRes, err := s.sdkConfiguration.Client.Do(req)
if err != nil || httpRes == nil {
if err != nil {
err = fmt.Errorf("error sending request: %w", err)
@@ -86,11 +89,10 @@ func (s *Log) LogLine(ctx context.Context, level operations.Level, message strin
return nil, err
}
}
contentType := httpRes.Header.Get("Content-Type")
res := &operations.LogLineResponse{
StatusCode: httpRes.StatusCode,
ContentType: contentType,
ContentType: httpRes.Header.Get("Content-Type"),
RawResponse: httpRes,
}
@@ -111,17 +113,19 @@ func (s *Log) LogLine(ctx context.Context, level operations.Level, message strin
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
case httpRes.StatusCode == 401:
switch {
case utils.MatchContentType(contentType, `application/json`):
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
var out sdkerrors.LogLineResponseBody
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
return nil, err
}
out.RawResponse = httpRes
out.RawResponse = httpRes
return nil, &out
default:
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes)
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
}
default:
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
}
return res, nil
@@ -153,6 +157,7 @@ func (s *Log) LogMultiLine(ctx context.Context, request string) (*operations.Log
hookCtx := hooks.HookContext{
Context: ctx,
OperationID: "logMultiLine",
OAuth2Scopes: []string{},
SecuritySource: s.sdkConfiguration.Security,
}
@@ -175,14 +180,16 @@ func (s *Log) LogMultiLine(ctx context.Context, request string) (*operations.Log
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
req.Header.Set("Content-Type", reqContentType)
client := s.sdkConfiguration.SecurityClient
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
return nil, err
}
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
if err != nil {
return nil, err
}
httpRes, err := client.Do(req)
httpRes, err := s.sdkConfiguration.Client.Do(req)
if err != nil || httpRes == nil {
if err != nil {
err = fmt.Errorf("error sending request: %w", err)
@@ -203,11 +210,10 @@ func (s *Log) LogMultiLine(ctx context.Context, request string) (*operations.Log
return nil, err
}
}
contentType := httpRes.Header.Get("Content-Type")
res := &operations.LogMultiLineResponse{
StatusCode: httpRes.StatusCode,
ContentType: contentType,
ContentType: httpRes.Header.Get("Content-Type"),
RawResponse: httpRes,
}
@@ -228,17 +234,19 @@ func (s *Log) LogMultiLine(ctx context.Context, request string) (*operations.Log
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
case httpRes.StatusCode == 401:
switch {
case utils.MatchContentType(contentType, `application/json`):
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
var out sdkerrors.LogMultiLineResponseBody
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
return nil, err
}
out.RawResponse = httpRes
out.RawResponse = httpRes
return nil, &out
default:
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes)
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
}
default:
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
}
return res, nil
@@ -250,6 +258,7 @@ func (s *Log) EnablePaperTrail(ctx context.Context) (*operations.EnablePaperTrai
hookCtx := hooks.HookContext{
Context: ctx,
OperationID: "enablePaperTrail",
OAuth2Scopes: []string{},
SecuritySource: s.sdkConfiguration.Security,
}
@@ -266,14 +275,16 @@ func (s *Log) EnablePaperTrail(ctx context.Context) (*operations.EnablePaperTrai
req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
client := s.sdkConfiguration.SecurityClient
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
return nil, err
}
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
if err != nil {
return nil, err
}
httpRes, err := client.Do(req)
httpRes, err := s.sdkConfiguration.Client.Do(req)
if err != nil || httpRes == nil {
if err != nil {
err = fmt.Errorf("error sending request: %w", err)
@@ -294,11 +305,10 @@ func (s *Log) EnablePaperTrail(ctx context.Context) (*operations.EnablePaperTrai
return nil, err
}
}
contentType := httpRes.Header.Get("Content-Type")
res := &operations.EnablePaperTrailResponse{
StatusCode: httpRes.StatusCode,
ContentType: contentType,
ContentType: httpRes.Header.Get("Content-Type"),
RawResponse: httpRes,
}
@@ -321,17 +331,19 @@ func (s *Log) EnablePaperTrail(ctx context.Context) (*operations.EnablePaperTrai
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
case httpRes.StatusCode == 401:
switch {
case utils.MatchContentType(contentType, `application/json`):
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
var out sdkerrors.EnablePaperTrailResponseBody
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
return nil, err
}
out.RawResponse = httpRes
out.RawResponse = httpRes
return nil, &out
default:
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes)
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
}
default:
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
}
return res, nil