Skip to content

Commit

Permalink
feat: Adds [CopilotSeatDetails, EnterpriseTeam], updates docs, remove…
Browse files Browse the repository at this point in the history
…s sync reference (#78)

* New updates to generated code

* New updates to generated code

---------

Co-authored-by: Octokit Bot <octokitbot@martynus.net>
  • Loading branch information
octokitbot and Octokit Bot committed Jun 14, 2024
1 parent feda140 commit 22d71c4
Show file tree
Hide file tree
Showing 15 changed files with 552 additions and 36 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ require (
github.com/microsoft/kiota-serialization-json-go v1.0.7
github.com/microsoft/kiota-serialization-multipart-go v1.0.0
github.com/microsoft/kiota-serialization-text-go v1.0.0
golang.org/x/sync v0.7.0
)

require (
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGX
go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
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": "EAF8A068E4D8873A357DB207B2686C5F61421902A300167633CFC77135B9F8D2B9CAE898577355E6188B350689BDEC26A54CF6CEAF4EF0246F0A669E5718456C",
"descriptionHash": "C4D764354C09F3368D481B03828B3989456CB5BFA95D3617D50FB8EDB5D482B43E04E026D0B7C8380C38BD215C9D5A45E08B8EF00FDD2A7A66EF8D2449ECFF03",
"descriptionLocation": "../../../../schemas/downloaded.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.14.0",
Expand Down
134 changes: 123 additions & 11 deletions pkg/github/models/copilot_seat_details.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ import (
type CopilotSeatDetails struct {
// The assignee that has been granted access to GitHub Copilot.
assignee CopilotSeatDetails_CopilotSeatDetails_assigneeable
// The team that granted access to GitHub Copilot to the assignee. This will be null if the user was assigned a seat individually.
assigning_team Teamable
// The team through which the assignee is granted access to GitHub Copilot, if applicable.
assigning_team CopilotSeatDetails_CopilotSeatDetails_assigning_teamable
// Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format.
created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time
// Timestamp of user's last GitHub Copilot activity, in ISO 8601 format.
last_activity_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time
// Last editor that was used by the user for a GitHub Copilot completion.
last_activity_editor *string
// The organization to which this seat belongs.
organization CopilotSeatDetails_organizationable
// The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle.
pending_cancellation_date *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly
// Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format.
Expand Down Expand Up @@ -114,6 +116,82 @@ func (m *CopilotSeatDetails_CopilotSeatDetails_assignee) SetSimpleUser(value Sim
func (m *CopilotSeatDetails_CopilotSeatDetails_assignee) SetTeam(value Teamable)() {
m.team = value
}
// CopilotSeatDetails_CopilotSeatDetails_assigning_team composed type wrapper for classes EnterpriseTeamable, Teamable
type CopilotSeatDetails_CopilotSeatDetails_assigning_team struct {
// Composed type representation for type EnterpriseTeamable
enterpriseTeam EnterpriseTeamable
// Composed type representation for type Teamable
team Teamable
}
// NewCopilotSeatDetails_CopilotSeatDetails_assigning_team instantiates a new CopilotSeatDetails_CopilotSeatDetails_assigning_team and sets the default values.
func NewCopilotSeatDetails_CopilotSeatDetails_assigning_team()(*CopilotSeatDetails_CopilotSeatDetails_assigning_team) {
m := &CopilotSeatDetails_CopilotSeatDetails_assigning_team{
}
return m
}
// CreateCopilotSeatDetails_CopilotSeatDetails_assigning_teamFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateCopilotSeatDetails_CopilotSeatDetails_assigning_teamFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
result := NewCopilotSeatDetails_CopilotSeatDetails_assigning_team()
if parseNode != nil {
mappingValueNode, err := parseNode.GetChildNode("")
if err != nil {
return nil, err
}
if mappingValueNode != nil {
mappingValue, err := mappingValueNode.GetStringValue()
if err != nil {
return nil, err
}
if mappingValue != nil {
}
}
}
return result, nil
}
// GetEnterpriseTeam gets the enterpriseTeam property value. Composed type representation for type EnterpriseTeamable
// returns a EnterpriseTeamable when successful
func (m *CopilotSeatDetails_CopilotSeatDetails_assigning_team) GetEnterpriseTeam()(EnterpriseTeamable) {
return m.enterpriseTeam
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *CopilotSeatDetails_CopilotSeatDetails_assigning_team) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error))
}
// GetIsComposedType determines if the current object is a wrapper around a composed type
// returns a bool when successful
func (m *CopilotSeatDetails_CopilotSeatDetails_assigning_team) GetIsComposedType()(bool) {
return true
}
// GetTeam gets the team property value. Composed type representation for type Teamable
// returns a Teamable when successful
func (m *CopilotSeatDetails_CopilotSeatDetails_assigning_team) GetTeam()(Teamable) {
return m.team
}
// Serialize serializes information the current object
func (m *CopilotSeatDetails_CopilotSeatDetails_assigning_team) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
if m.GetEnterpriseTeam() != nil {
err := writer.WriteObjectValue("", m.GetEnterpriseTeam())
if err != nil {
return err
}
} else if m.GetTeam() != nil {
err := writer.WriteObjectValue("", m.GetTeam())
if err != nil {
return err
}
}
return nil
}
// SetEnterpriseTeam sets the enterpriseTeam property value. Composed type representation for type EnterpriseTeamable
func (m *CopilotSeatDetails_CopilotSeatDetails_assigning_team) SetEnterpriseTeam(value EnterpriseTeamable)() {
m.enterpriseTeam = value
}
// SetTeam sets the team property value. Composed type representation for type Teamable
func (m *CopilotSeatDetails_CopilotSeatDetails_assigning_team) SetTeam(value Teamable)() {
m.team = value
}
type CopilotSeatDetails_CopilotSeatDetails_assigneeable interface {
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetOrganization()(Organizationable)
Expand All @@ -123,6 +201,13 @@ type CopilotSeatDetails_CopilotSeatDetails_assigneeable interface {
SetSimpleUser(value SimpleUserable)()
SetTeam(value Teamable)()
}
type CopilotSeatDetails_CopilotSeatDetails_assigning_teamable interface {
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetEnterpriseTeam()(EnterpriseTeamable)
GetTeam()(Teamable)
SetEnterpriseTeam(value EnterpriseTeamable)()
SetTeam(value Teamable)()
}
// NewCopilotSeatDetails instantiates a new CopilotSeatDetails and sets the default values.
func NewCopilotSeatDetails()(*CopilotSeatDetails) {
m := &CopilotSeatDetails{
Expand All @@ -139,9 +224,9 @@ func CreateCopilotSeatDetailsFromDiscriminatorValue(parseNode i878a80d2330e89d26
func (m *CopilotSeatDetails) GetAssignee()(CopilotSeatDetails_CopilotSeatDetails_assigneeable) {
return m.assignee
}
// GetAssigningTeam gets the assigning_team property value. The team that granted access to GitHub Copilot to the assignee. This will be null if the user was assigned a seat individually.
// returns a Teamable when successful
func (m *CopilotSeatDetails) GetAssigningTeam()(Teamable) {
// GetAssigningTeam gets the assigning_team property value. The team through which the assignee is granted access to GitHub Copilot, if applicable.
// returns a CopilotSeatDetails_CopilotSeatDetails_assigning_teamable when successful
func (m *CopilotSeatDetails) GetAssigningTeam()(CopilotSeatDetails_CopilotSeatDetails_assigning_teamable) {
return m.assigning_team
}
// GetCreatedAt gets the created_at property value. Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format.
Expand All @@ -164,12 +249,12 @@ func (m *CopilotSeatDetails) GetFieldDeserializers()(map[string]func(i878a80d233
return nil
}
res["assigning_team"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateTeamFromDiscriminatorValue)
val, err := n.GetObjectValue(CreateCopilotSeatDetails_CopilotSeatDetails_assigning_teamFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetAssigningTeam(val.(Teamable))
m.SetAssigningTeam(val.(CopilotSeatDetails_CopilotSeatDetails_assigning_teamable))
}
return nil
}
Expand Down Expand Up @@ -203,6 +288,16 @@ func (m *CopilotSeatDetails) GetFieldDeserializers()(map[string]func(i878a80d233
}
return nil
}
res["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateCopilotSeatDetails_organizationFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetOrganization(val.(CopilotSeatDetails_organizationable))
}
return nil
}
res["pending_cancellation_date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetDateOnlyValue()
if err != nil {
Expand Down Expand Up @@ -235,6 +330,11 @@ func (m *CopilotSeatDetails) GetLastActivityAt()(*i336074805fc853987abe6f7fe3ad9
func (m *CopilotSeatDetails) GetLastActivityEditor()(*string) {
return m.last_activity_editor
}
// GetOrganization gets the organization property value. The organization to which this seat belongs.
// returns a CopilotSeatDetails_organizationable when successful
func (m *CopilotSeatDetails) GetOrganization()(CopilotSeatDetails_organizationable) {
return m.organization
}
// GetPendingCancellationDate gets the pending_cancellation_date property value. The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle.
// returns a *DateOnly when successful
func (m *CopilotSeatDetails) GetPendingCancellationDate()(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly) {
Expand Down Expand Up @@ -277,6 +377,12 @@ func (m *CopilotSeatDetails) Serialize(writer i878a80d2330e89d26896388a3f487eef2
return err
}
}
{
err := writer.WriteObjectValue("organization", m.GetOrganization())
if err != nil {
return err
}
}
{
err := writer.WriteDateOnlyValue("pending_cancellation_date", m.GetPendingCancellationDate())
if err != nil {
Expand All @@ -295,8 +401,8 @@ func (m *CopilotSeatDetails) Serialize(writer i878a80d2330e89d26896388a3f487eef2
func (m *CopilotSeatDetails) SetAssignee(value CopilotSeatDetails_CopilotSeatDetails_assigneeable)() {
m.assignee = value
}
// SetAssigningTeam sets the assigning_team property value. The team that granted access to GitHub Copilot to the assignee. This will be null if the user was assigned a seat individually.
func (m *CopilotSeatDetails) SetAssigningTeam(value Teamable)() {
// SetAssigningTeam sets the assigning_team property value. The team through which the assignee is granted access to GitHub Copilot, if applicable.
func (m *CopilotSeatDetails) SetAssigningTeam(value CopilotSeatDetails_CopilotSeatDetails_assigning_teamable)() {
m.assigning_team = value
}
// SetCreatedAt sets the created_at property value. Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format.
Expand All @@ -311,6 +417,10 @@ func (m *CopilotSeatDetails) SetLastActivityAt(value *i336074805fc853987abe6f7fe
func (m *CopilotSeatDetails) SetLastActivityEditor(value *string)() {
m.last_activity_editor = value
}
// SetOrganization sets the organization property value. The organization to which this seat belongs.
func (m *CopilotSeatDetails) SetOrganization(value CopilotSeatDetails_organizationable)() {
m.organization = value
}
// SetPendingCancellationDate sets the pending_cancellation_date property value. The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle.
func (m *CopilotSeatDetails) SetPendingCancellationDate(value *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly)() {
m.pending_cancellation_date = value
Expand All @@ -322,17 +432,19 @@ func (m *CopilotSeatDetails) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97
type CopilotSeatDetailsable interface {
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetAssignee()(CopilotSeatDetails_CopilotSeatDetails_assigneeable)
GetAssigningTeam()(Teamable)
GetAssigningTeam()(CopilotSeatDetails_CopilotSeatDetails_assigning_teamable)
GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetLastActivityAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetLastActivityEditor()(*string)
GetOrganization()(CopilotSeatDetails_organizationable)
GetPendingCancellationDate()(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly)
GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
SetAssignee(value CopilotSeatDetails_CopilotSeatDetails_assigneeable)()
SetAssigningTeam(value Teamable)()
SetAssigningTeam(value CopilotSeatDetails_CopilotSeatDetails_assigning_teamable)()
SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetLastActivityAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetLastActivityEditor(value *string)()
SetOrganization(value CopilotSeatDetails_organizationable)()
SetPendingCancellationDate(value *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly)()
SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
}
52 changes: 52 additions & 0 deletions pkg/github/models/copilot_seat_details_organization.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package models

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

// CopilotSeatDetails_organization the organization to which this seat belongs.
type CopilotSeatDetails_organization struct {
// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
additionalData map[string]any
}
// NewCopilotSeatDetails_organization instantiates a new CopilotSeatDetails_organization and sets the default values.
func NewCopilotSeatDetails_organization()(*CopilotSeatDetails_organization) {
m := &CopilotSeatDetails_organization{
}
m.SetAdditionalData(make(map[string]any))
return m
}
// CreateCopilotSeatDetails_organizationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateCopilotSeatDetails_organizationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewCopilotSeatDetails_organization(), nil
}
// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
// returns a map[string]any when successful
func (m *CopilotSeatDetails_organization) GetAdditionalData()(map[string]any) {
return m.additionalData
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *CopilotSeatDetails_organization) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error))
return res
}
// Serialize serializes information the current object
func (m *CopilotSeatDetails_organization) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
{
err := writer.WriteAdditionalData(m.GetAdditionalData())
if err != nil {
return err
}
}
return nil
}
// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
func (m *CopilotSeatDetails_organization) SetAdditionalData(value map[string]any)() {
m.additionalData = value
}
type CopilotSeatDetails_organizationable interface {
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
}
Loading

0 comments on commit 22d71c4

Please sign in to comment.