Skip to content

Commit

Permalink
feat: Changes in generated code
Browse files Browse the repository at this point in the history
* New updates to generated code

* New updates to generated code
  • Loading branch information
octokitbot authored Oct 30, 2024
1 parent aad007e commit 89e3e56
Show file tree
Hide file tree
Showing 37 changed files with 2,825 additions and 8,094 deletions.
81 changes: 81 additions & 0 deletions pkg/github/enterprises/item_copilot_metrics_request_builder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
package enterprises

import (
"context"
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models"
)

// ItemCopilotMetricsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\copilot\metrics
type ItemCopilotMetricsRequestBuilder struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}
// ItemCopilotMetricsRequestBuilderGetQueryParameters use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only enterprise owners and billing managers can view Copilot metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint.
type ItemCopilotMetricsRequestBuilderGetQueryParameters struct {
// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
Page *int32 `uriparametername:"page"`
// The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
Per_page *int32 `uriparametername:"per_page"`
// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago.
Since *string `uriparametername:"since"`
// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed.
Until *string `uriparametername:"until"`
}
// NewItemCopilotMetricsRequestBuilderInternal instantiates a new ItemCopilotMetricsRequestBuilder and sets the default values.
func NewItemCopilotMetricsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotMetricsRequestBuilder) {
m := &ItemCopilotMetricsRequestBuilder{
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot/metrics{?page*,per_page*,since*,until*}", pathParameters),
}
return m
}
// NewItemCopilotMetricsRequestBuilder instantiates a new ItemCopilotMetricsRequestBuilder and sets the default values.
func NewItemCopilotMetricsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotMetricsRequestBuilder) {
urlParams := make(map[string]string)
urlParams["request-raw-url"] = rawUrl
return NewItemCopilotMetricsRequestBuilderInternal(urlParams, requestAdapter)
}
// Get use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only enterprise owners and billing managers can view Copilot metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint.
// returns a []CopilotUsageMetricsDayable when successful
// returns a BasicError error when the service returns a 403 status code
// returns a BasicError error when the service returns a 404 status code
// returns a BasicError error when the service returns a 422 status code
// returns a BasicError error when the service returns a 500 status code
// [API method documentation]
//
// [API method documentation]: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise
func (m *ItemCopilotMetricsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCopilotMetricsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsDayable, error) {
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);
if err != nil {
return nil, err
}
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {
"403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue,
"404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue,
"422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue,
"500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue,
}
res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCopilotUsageMetricsDayFromDiscriminatorValue, errorMapping)
if err != nil {
return nil, err
}
val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsDayable, len(res))
for i, v := range res {
if v != nil {
val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsDayable)
}
}
return val, nil
}
// ToGetRequestInformation use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only enterprise owners and billing managers can view Copilot metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint.
// returns a *RequestInformation when successful
func (m *ItemCopilotMetricsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCopilotMetricsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters)
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration)
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 *ItemCopilotMetricsRequestBuilder when successful
func (m *ItemCopilotMetricsRequestBuilder) WithUrl(rawUrl string)(*ItemCopilotMetricsRequestBuilder) {
return NewItemCopilotMetricsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter);
}
5 changes: 5 additions & 0 deletions pkg/github/enterprises/item_copilot_request_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ func NewItemCopilotRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26
urlParams["request-raw-url"] = rawUrl
return NewItemCopilotRequestBuilderInternal(urlParams, requestAdapter)
}
// Metrics the metrics property
// returns a *ItemCopilotMetricsRequestBuilder when successful
func (m *ItemCopilotRequestBuilder) Metrics()(*ItemCopilotMetricsRequestBuilder) {
return NewItemCopilotMetricsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter)
}
// Usage the usage property
// returns a *ItemCopilotUsageRequestBuilder when successful
func (m *ItemCopilotRequestBuilder) Usage()(*ItemCopilotUsageRequestBuilder) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
package enterprises

import (
"context"
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models"
)

// ItemTeamItemCopilotMetricsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\team\{team_slug}\copilot\metrics
type ItemTeamItemCopilotMetricsRequestBuilder struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}
// ItemTeamItemCopilotMetricsRequestBuilderGetQueryParameters use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.> [!NOTE]> This endpoint will only return results for a given day if the enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint.
type ItemTeamItemCopilotMetricsRequestBuilderGetQueryParameters struct {
// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
Page *int32 `uriparametername:"page"`
// The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
Per_page *int32 `uriparametername:"per_page"`
// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago.
Since *string `uriparametername:"since"`
// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed.
Until *string `uriparametername:"until"`
}
// NewItemTeamItemCopilotMetricsRequestBuilderInternal instantiates a new ItemTeamItemCopilotMetricsRequestBuilder and sets the default values.
func NewItemTeamItemCopilotMetricsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamItemCopilotMetricsRequestBuilder) {
m := &ItemTeamItemCopilotMetricsRequestBuilder{
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/team/{team_slug}/copilot/metrics{?page*,per_page*,since*,until*}", pathParameters),
}
return m
}
// NewItemTeamItemCopilotMetricsRequestBuilder instantiates a new ItemTeamItemCopilotMetricsRequestBuilder and sets the default values.
func NewItemTeamItemCopilotMetricsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamItemCopilotMetricsRequestBuilder) {
urlParams := make(map[string]string)
urlParams["request-raw-url"] = rawUrl
return NewItemTeamItemCopilotMetricsRequestBuilderInternal(urlParams, requestAdapter)
}
// Get use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.> [!NOTE]> This endpoint will only return results for a given day if the enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint.
// returns a []CopilotUsageMetricsDayable when successful
// returns a BasicError error when the service returns a 403 status code
// returns a BasicError error when the service returns a 404 status code
// returns a BasicError error when the service returns a 422 status code
// returns a BasicError error when the service returns a 500 status code
// [API method documentation]
//
// [API method documentation]: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise-team
func (m *ItemTeamItemCopilotMetricsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamItemCopilotMetricsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsDayable, error) {
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);
if err != nil {
return nil, err
}
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {
"403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue,
"404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue,
"422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue,
"500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue,
}
res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCopilotUsageMetricsDayFromDiscriminatorValue, errorMapping)
if err != nil {
return nil, err
}
val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsDayable, len(res))
for i, v := range res {
if v != nil {
val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsDayable)
}
}
return val, nil
}
// ToGetRequestInformation use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.> [!NOTE]> This endpoint will only return results for a given day if the enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint.
// returns a *RequestInformation when successful
func (m *ItemTeamItemCopilotMetricsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamItemCopilotMetricsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters)
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration)
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 *ItemTeamItemCopilotMetricsRequestBuilder when successful
func (m *ItemTeamItemCopilotMetricsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamItemCopilotMetricsRequestBuilder) {
return NewItemTeamItemCopilotMetricsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ func NewItemTeamItemCopilotRequestBuilder(rawUrl string, requestAdapter i2ae4187
urlParams["request-raw-url"] = rawUrl
return NewItemTeamItemCopilotRequestBuilderInternal(urlParams, requestAdapter)
}
// Metrics the metrics property
// returns a *ItemTeamItemCopilotMetricsRequestBuilder when successful
func (m *ItemTeamItemCopilotRequestBuilder) Metrics()(*ItemTeamItemCopilotMetricsRequestBuilder) {
return NewItemTeamItemCopilotMetricsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter)
}
// Usage the usage property
// returns a *ItemTeamItemCopilotUsageRequestBuilder when successful
func (m *ItemTeamItemCopilotRequestBuilder) Usage()(*ItemTeamItemCopilotUsageRequestBuilder) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/github/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"descriptionHash": "93BEAB2B4615A191CA86B79FF0A3FC794655717BEF6D602BDA0DFD8E3CE1011751A1112EB5F673E268C12658D3CF9658EF2CFE1BD861435D6770F9168D20811C",
"descriptionHash": "5459CA11128EA114CCBEE2FB305F8DE4EC02841EAE36035698735C0ABC3D252974132381FCA3063DA1998CA649237F6AF7ACBB41682494126FFF13B4F5A284B7",
"descriptionLocation": "../../../../../schemas/api.github.com.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.19.0",
Expand Down
Loading

0 comments on commit 89e3e56

Please sign in to comment.