Skip to content

Commit

Permalink
Changes in generated code (#98)
Browse files Browse the repository at this point in the history
* New updates to generated code

* New updates to generated code

* New updates to generated code

* New updates to generated code

* New updates to generated code
  • Loading branch information
octokitbot committed Aug 15, 2024
1 parent d1e4b69 commit 22160bb
Show file tree
Hide file tree
Showing 51 changed files with 1,661 additions and 1,390 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
> [!IMPORTANT]
> This SDK is not yet stable. Breaking changes may occur at any time.
# github.com/octokit/go-sdk

An "alpha" version of a generated Go SDK for the standard GitHub.com product, generated from [GitHub's OpenAPI spec](https://github.com/github/rest-api-description), built on [Kiota](https://github.com/microsoft/kiota).
Expand All @@ -20,20 +23,21 @@ You may also want:
- [NuGet link](https://www.nuget.org/packages/GitHub.Octokit.SDK)
- For GitHub Enterprise Cloud
- [dotnet-sdk-enterprise-cloud repository](https://github.com/octokit/dotnet-sdk-enterprise-cloud)
- [NuGet link](https://www.nuget.org/packages/GitHub.Octokit.GHEC.SDK/)
- For GitHub Enterprise Server
- [dotnet-sdk-enterprise-server repository](https://github.com/octokit/dotnet-sdk-enterprise-server)
- [NuGet link](https://www.nuget.org/packages?q=GitHub.Octokit.GHES.SDK)
- For our classic non-generated, hand-maintained Octokit.net project
- [Octokit.net repository](https://github.com/octokit/octokit.net)
- For why we're building generative SDKs, see [Why a generated SDK?](#why-a-generated-sdk) below
- [NuGet link](https://www.nuget.org/packages/Octokit/)
- [source-generator](https://github.com/octokit/source-generator) (the repository that creates these generated SDKs)
- Contributions to this repository should take place in source-generator instead, as they'll be distributed here through mechanisms there.
- For why we're building generative SDKs, see [Why a generated SDK?](#why-a-generated-sdk) below

## How do I use it?

See example client instantiations and requests in [example_test.go](pkg/example_test.go) or in the [cmd/ directory](cmd/).

⚠️ **Note**: This SDK is not yet stable. Breaking changes may occur at any time.

### Building and testing

- Build the SDK: `go build ./...`
Expand Down Expand Up @@ -83,9 +87,7 @@ Authenticating as an App installation can be done using the `WithGitHubAppAuthen

## Why a generated SDK?

We want to...
1. provide 100% coverage of the API in our SDK
2. use this as a building block for future SDK tooling.
Please take a moment and head over to the GitHub blog to read more about the [why's and how's behind our move to Generative SDKs](https://github.blog/news-insights/product-news/our-move-to-generated-sdks/).

## Why Go?

Expand Down
6 changes: 3 additions & 3 deletions pkg/github/enterprises/item_copilot_usage_request_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
type ItemCopilotUsageRequestBuilder struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}
// ItemCopilotUsageRequestBuilderGetQueryParameters > [!NOTE]> This endpoint is in beta and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEfor all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances,and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.The response contains metrics for the prior 28 days. Usage 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.Only owners and billing managers can view Copilot usage 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.
// ItemCopilotUsageRequestBuilderGetQueryParameters > [!NOTE]> This endpoint is in beta and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEfor all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances,and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. Usage 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.Only owners and billing managers can view Copilot usage 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 ItemCopilotUsageRequestBuilderGetQueryParameters 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"`
Expand All @@ -34,7 +34,7 @@ func NewItemCopilotUsageRequestBuilder(rawUrl string, requestAdapter i2ae4187f7d
urlParams["request-raw-url"] = rawUrl
return NewItemCopilotUsageRequestBuilderInternal(urlParams, requestAdapter)
}
// Get > [!NOTE]> This endpoint is in beta and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEfor all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances,and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.The response contains metrics for the prior 28 days. Usage 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.Only owners and billing managers can view Copilot usage 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.
// Get > [!NOTE]> This endpoint is in beta and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEfor all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances,and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. Usage 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.Only owners and billing managers can view Copilot usage 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 []CopilotUsageMetricsable when successful
// returns a BasicError error when the service returns a 401 status code
// returns a BasicError error when the service returns a 403 status code
Expand Down Expand Up @@ -66,7 +66,7 @@ func (m *ItemCopilotUsageRequestBuilder) Get(ctx context.Context, requestConfigu
}
return val, nil
}
// ToGetRequestInformation > [!NOTE]> This endpoint is in beta and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEfor all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances,and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.The response contains metrics for the prior 28 days. Usage 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.Only owners and billing managers can view Copilot usage 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.
// ToGetRequestInformation > [!NOTE]> This endpoint is in beta and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEfor all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances,and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. Usage 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.Only owners and billing managers can view Copilot usage 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 *ItemCopilotUsageRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCopilotUsageRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters)
Expand Down
28 changes: 28 additions & 0 deletions pkg/github/enterprises/item_team_item_copilot_request_builder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package enterprises

import (
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
)

// ItemTeamItemCopilotRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\team\{team_slug}\copilot
type ItemTeamItemCopilotRequestBuilder struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}
// NewItemTeamItemCopilotRequestBuilderInternal instantiates a new ItemTeamItemCopilotRequestBuilder and sets the default values.
func NewItemTeamItemCopilotRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamItemCopilotRequestBuilder) {
m := &ItemTeamItemCopilotRequestBuilder{
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/team/{team_slug}/copilot", pathParameters),
}
return m
}
// NewItemTeamItemCopilotRequestBuilder instantiates a new ItemTeamItemCopilotRequestBuilder and sets the default values.
func NewItemTeamItemCopilotRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamItemCopilotRequestBuilder) {
urlParams := make(map[string]string)
urlParams["request-raw-url"] = rawUrl
return NewItemTeamItemCopilotRequestBuilderInternal(urlParams, requestAdapter)
}
// Usage the usage property
// returns a *ItemTeamItemCopilotUsageRequestBuilder when successful
func (m *ItemTeamItemCopilotRequestBuilder) Usage()(*ItemTeamItemCopilotUsageRequestBuilder) {
return NewItemTeamItemCopilotUsageRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter)
}
Loading

0 comments on commit 22160bb

Please sign in to comment.