Skip to content

Commit 053101d

Browse files
JACK SARTOREGitHub Enterprise
JACK SARTORE
authored and
GitHub Enterprise
committed
feat(api): SDK update 20230606-124943 (#43)
1 parent e218249 commit 053101d

File tree

4 files changed

+40
-425
lines changed

4 files changed

+40
-425
lines changed

codeenginev2/code_engine_v2.go

Lines changed: 18 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -461,66 +461,6 @@ func (codeEngine *CodeEngineV2) GetProjectEgressIpsWithContext(ctx context.Conte
461461
return
462462
}
463463

464-
// GetProjectStatusDetails : Get the status details for a project
465-
// Retrieves status details about the given project.
466-
func (codeEngine *CodeEngineV2) GetProjectStatusDetails(getProjectStatusDetailsOptions *GetProjectStatusDetailsOptions) (result *ProjectStatusDetails, response *core.DetailedResponse, err error) {
467-
return codeEngine.GetProjectStatusDetailsWithContext(context.Background(), getProjectStatusDetailsOptions)
468-
}
469-
470-
// GetProjectStatusDetailsWithContext is an alternate form of the GetProjectStatusDetails method which supports a Context parameter
471-
func (codeEngine *CodeEngineV2) GetProjectStatusDetailsWithContext(ctx context.Context, getProjectStatusDetailsOptions *GetProjectStatusDetailsOptions) (result *ProjectStatusDetails, response *core.DetailedResponse, err error) {
472-
err = core.ValidateNotNil(getProjectStatusDetailsOptions, "getProjectStatusDetailsOptions cannot be nil")
473-
if err != nil {
474-
return
475-
}
476-
err = core.ValidateStruct(getProjectStatusDetailsOptions, "getProjectStatusDetailsOptions")
477-
if err != nil {
478-
return
479-
}
480-
481-
pathParamsMap := map[string]string{
482-
"project_id": *getProjectStatusDetailsOptions.ProjectID,
483-
}
484-
485-
builder := core.NewRequestBuilder(core.GET)
486-
builder = builder.WithContext(ctx)
487-
builder.EnableGzipCompression = codeEngine.GetEnableGzipCompression()
488-
_, err = builder.ResolveRequestURL(codeEngine.Service.Options.URL, `/projects/{project_id}/status_details`, pathParamsMap)
489-
if err != nil {
490-
return
491-
}
492-
493-
for headerName, headerValue := range getProjectStatusDetailsOptions.Headers {
494-
builder.AddHeader(headerName, headerValue)
495-
}
496-
497-
sdkHeaders := common.GetSdkHeaders("code_engine", "V2", "GetProjectStatusDetails")
498-
for headerName, headerValue := range sdkHeaders {
499-
builder.AddHeader(headerName, headerValue)
500-
}
501-
builder.AddHeader("Accept", "application/json")
502-
503-
request, err := builder.Build()
504-
if err != nil {
505-
return
506-
}
507-
508-
var rawResponse map[string]json.RawMessage
509-
response, err = codeEngine.Service.Request(request, &rawResponse)
510-
if err != nil {
511-
return
512-
}
513-
if rawResponse != nil {
514-
err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalProjectStatusDetails)
515-
if err != nil {
516-
return
517-
}
518-
response.Result = result
519-
}
520-
521-
return
522-
}
523-
524464
// ListApps : List applications
525465
// List all applications in a project.
526466
func (codeEngine *CodeEngineV2) ListApps(listAppsOptions *ListAppsOptions) (result *AppList, response *core.DetailedResponse, err error) {
@@ -3201,13 +3141,13 @@ func (codeEngine *CodeEngineV2) GetBindingWithContext(ctx context.Context, getBi
32013141

32023142
pathParamsMap := map[string]string{
32033143
"project_id": *getBindingOptions.ProjectID,
3204-
"name": *getBindingOptions.Name,
3144+
"id": *getBindingOptions.ID,
32053145
}
32063146

32073147
builder := core.NewRequestBuilder(core.GET)
32083148
builder = builder.WithContext(ctx)
32093149
builder.EnableGzipCompression = codeEngine.GetEnableGzipCompression()
3210-
_, err = builder.ResolveRequestURL(codeEngine.Service.Options.URL, `/projects/{project_id}/bindings/{name}`, pathParamsMap)
3150+
_, err = builder.ResolveRequestURL(codeEngine.Service.Options.URL, `/projects/{project_id}/bindings/{id}`, pathParamsMap)
32113151
if err != nil {
32123152
return
32133153
}
@@ -3262,13 +3202,13 @@ func (codeEngine *CodeEngineV2) DeleteBindingWithContext(ctx context.Context, de
32623202

32633203
pathParamsMap := map[string]string{
32643204
"project_id": *deleteBindingOptions.ProjectID,
3265-
"name": *deleteBindingOptions.Name,
3205+
"id": *deleteBindingOptions.ID,
32663206
}
32673207

32683208
builder := core.NewRequestBuilder(core.DELETE)
32693209
builder = builder.WithContext(ctx)
32703210
builder.EnableGzipCompression = codeEngine.GetEnableGzipCompression()
3271-
_, err = builder.ResolveRequestURL(codeEngine.Service.Options.URL, `/projects/{project_id}/bindings/{name}`, pathParamsMap)
3211+
_, err = builder.ResolveRequestURL(codeEngine.Service.Options.URL, `/projects/{project_id}/bindings/{id}`, pathParamsMap)
32723212
if err != nil {
32733213
return
32743214
}
@@ -6552,18 +6492,18 @@ type DeleteBindingOptions struct {
65526492
// The ID of the project.
65536493
ProjectID *string `json:"project_id" validate:"required,ne="`
65546494

6555-
// The name of your binding.
6556-
Name *string `json:"name" validate:"required,ne="`
6495+
// The id of your binding.
6496+
ID *string `json:"id" validate:"required,ne="`
65576497

65586498
// Allows users to set headers on API requests
65596499
Headers map[string]string
65606500
}
65616501

65626502
// NewDeleteBindingOptions : Instantiate DeleteBindingOptions
6563-
func (*CodeEngineV2) NewDeleteBindingOptions(projectID string, name string) *DeleteBindingOptions {
6503+
func (*CodeEngineV2) NewDeleteBindingOptions(projectID string, id string) *DeleteBindingOptions {
65646504
return &DeleteBindingOptions{
65656505
ProjectID: core.StringPtr(projectID),
6566-
Name: core.StringPtr(name),
6506+
ID: core.StringPtr(id),
65676507
}
65686508
}
65696509

@@ -6573,9 +6513,9 @@ func (_options *DeleteBindingOptions) SetProjectID(projectID string) *DeleteBind
65736513
return _options
65746514
}
65756515

6576-
// SetName : Allow user to set Name
6577-
func (_options *DeleteBindingOptions) SetName(name string) *DeleteBindingOptions {
6578-
_options.Name = core.StringPtr(name)
6516+
// SetID : Allow user to set ID
6517+
func (_options *DeleteBindingOptions) SetID(id string) *DeleteBindingOptions {
6518+
_options.ID = core.StringPtr(id)
65796519
return _options
65806520
}
65816521

@@ -7056,18 +6996,18 @@ type GetBindingOptions struct {
70566996
// The ID of the project.
70576997
ProjectID *string `json:"project_id" validate:"required,ne="`
70586998

7059-
// The name of your binding.
7060-
Name *string `json:"name" validate:"required,ne="`
6999+
// The id of your binding.
7000+
ID *string `json:"id" validate:"required,ne="`
70617001

70627002
// Allows users to set headers on API requests
70637003
Headers map[string]string
70647004
}
70657005

70667006
// NewGetBindingOptions : Instantiate GetBindingOptions
7067-
func (*CodeEngineV2) NewGetBindingOptions(projectID string, name string) *GetBindingOptions {
7007+
func (*CodeEngineV2) NewGetBindingOptions(projectID string, id string) *GetBindingOptions {
70687008
return &GetBindingOptions{
70697009
ProjectID: core.StringPtr(projectID),
7070-
Name: core.StringPtr(name),
7010+
ID: core.StringPtr(id),
70717011
}
70727012
}
70737013

@@ -7077,9 +7017,9 @@ func (_options *GetBindingOptions) SetProjectID(projectID string) *GetBindingOpt
70777017
return _options
70787018
}
70797019

7080-
// SetName : Allow user to set Name
7081-
func (_options *GetBindingOptions) SetName(name string) *GetBindingOptions {
7082-
_options.Name = core.StringPtr(name)
7020+
// SetID : Allow user to set ID
7021+
func (_options *GetBindingOptions) SetID(id string) *GetBindingOptions {
7022+
_options.ID = core.StringPtr(id)
70837023
return _options
70847024
}
70857025

@@ -7335,34 +7275,6 @@ func (options *GetProjectOptions) SetHeaders(param map[string]string) *GetProjec
73357275
return options
73367276
}
73377277

7338-
// GetProjectStatusDetailsOptions : The GetProjectStatusDetails options.
7339-
type GetProjectStatusDetailsOptions struct {
7340-
// The ID of the project.
7341-
ProjectID *string `json:"project_id" validate:"required,ne="`
7342-
7343-
// Allows users to set headers on API requests
7344-
Headers map[string]string
7345-
}
7346-
7347-
// NewGetProjectStatusDetailsOptions : Instantiate GetProjectStatusDetailsOptions
7348-
func (*CodeEngineV2) NewGetProjectStatusDetailsOptions(projectID string) *GetProjectStatusDetailsOptions {
7349-
return &GetProjectStatusDetailsOptions{
7350-
ProjectID: core.StringPtr(projectID),
7351-
}
7352-
}
7353-
7354-
// SetProjectID : Allow user to set ProjectID
7355-
func (_options *GetProjectStatusDetailsOptions) SetProjectID(projectID string) *GetProjectStatusDetailsOptions {
7356-
_options.ProjectID = core.StringPtr(projectID)
7357-
return _options
7358-
}
7359-
7360-
// SetHeaders : Allow user to set Headers
7361-
func (options *GetProjectStatusDetailsOptions) SetHeaders(param map[string]string) *GetProjectStatusDetailsOptions {
7362-
options.Headers = param
7363-
return options
7364-
}
7365-
73667278
// GetSecretOptions : The GetSecret options.
73677279
type GetSecretOptions struct {
73687280
// The ID of the project.
@@ -8886,44 +8798,6 @@ func (resp *ProjectList) GetNextStart() (*string, error) {
88868798
return resp.Next.Start, nil
88878799
}
88888800

8889-
// ProjectStatusDetails : Describes the model of a project status details.
8890-
type ProjectStatusDetails struct {
8891-
// Status of the domain created for the project.
8892-
Domain *string `json:"domain" validate:"required"`
8893-
8894-
// Defines whether a project is enabled for management and consumption.
8895-
Project *string `json:"project" validate:"required"`
8896-
}
8897-
8898-
// Constants associated with the ProjectStatusDetails.Domain property.
8899-
// Status of the domain created for the project.
8900-
const (
8901-
ProjectStatusDetails_Domain_Ready = "ready"
8902-
ProjectStatusDetails_Domain_Unknown = "unknown"
8903-
)
8904-
8905-
// Constants associated with the ProjectStatusDetails.Project property.
8906-
// Defines whether a project is enabled for management and consumption.
8907-
const (
8908-
ProjectStatusDetails_Project_Disabled = "disabled"
8909-
ProjectStatusDetails_Project_Enabled = "enabled"
8910-
)
8911-
8912-
// UnmarshalProjectStatusDetails unmarshals an instance of ProjectStatusDetails from the specified map of raw messages.
8913-
func UnmarshalProjectStatusDetails(m map[string]json.RawMessage, result interface{}) (err error) {
8914-
obj := new(ProjectStatusDetails)
8915-
err = core.UnmarshalPrimitive(m, "domain", &obj.Domain)
8916-
if err != nil {
8917-
return
8918-
}
8919-
err = core.UnmarshalPrimitive(m, "project", &obj.Project)
8920-
if err != nil {
8921-
return
8922-
}
8923-
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
8924-
return
8925-
}
8926-
89278801
// ReplaceConfigMapOptions : The ReplaceConfigMap options.
89288802
type ReplaceConfigMapOptions struct {
89298803
// The ID of the project.

codeenginev2/code_engine_v2_examples_test.go

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -189,27 +189,6 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
189189
Expect(response.StatusCode).To(Equal(200))
190190
Expect(projectEgressIpAddresses).ToNot(BeNil())
191191
})
192-
It(`GetProjectStatusDetails request example`, func() {
193-
fmt.Println("\nGetProjectStatusDetails() result:")
194-
// begin-get_project_status_details
195-
196-
getProjectStatusDetailsOptions := codeEngineService.NewGetProjectStatusDetailsOptions(
197-
"15314cc3-85b4-4338-903f-c28cdee6d005",
198-
)
199-
200-
projectStatusDetails, response, err := codeEngineService.GetProjectStatusDetails(getProjectStatusDetailsOptions)
201-
if err != nil {
202-
panic(err)
203-
}
204-
b, _ := json.MarshalIndent(projectStatusDetails, "", " ")
205-
fmt.Println(string(b))
206-
207-
// end-get_project_status_details
208-
209-
Expect(err).To(BeNil())
210-
Expect(response.StatusCode).To(Equal(200))
211-
Expect(projectStatusDetails).ToNot(BeNil())
212-
})
213192
It(`ListApps request example`, func() {
214193
fmt.Println("\nListApps() result:")
215194
// begin-list_apps
@@ -939,7 +918,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
939918

940919
getBindingOptions := codeEngineService.NewGetBindingOptions(
941920
"15314cc3-85b4-4338-903f-c28cdee6d005",
942-
"app_my-app-1_my-service-access_PREFIX",
921+
"a172ced-b5f21bc-71ba50c-1638604",
943922
)
944923

945924
binding, response, err := codeEngineService.GetBinding(getBindingOptions)
@@ -1149,7 +1128,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
11491128

11501129
deleteBindingOptions := codeEngineService.NewDeleteBindingOptions(
11511130
"15314cc3-85b4-4338-903f-c28cdee6d005",
1152-
"app_my-app-1_my-service-access_PREFIX",
1131+
"a172ced-b5f21bc-71ba50c-1638604",
11531132
)
11541133

11551134
response, err := codeEngineService.DeleteBinding(deleteBindingOptions)

codeenginev2/code_engine_v2_integration_test.go

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -203,22 +203,6 @@ var _ = Describe(`CodeEngineV2 Integration Tests`, func() {
203203
})
204204
})
205205

206-
Describe(`GetProjectStatusDetails - Get the status details for a project`, func() {
207-
BeforeEach(func() {
208-
shouldSkipTest()
209-
})
210-
It(`GetProjectStatusDetails(getProjectStatusDetailsOptions *GetProjectStatusDetailsOptions)`, func() {
211-
getProjectStatusDetailsOptions := &codeenginev2.GetProjectStatusDetailsOptions{
212-
ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"),
213-
}
214-
215-
projectStatusDetails, response, err := codeEngineService.GetProjectStatusDetails(getProjectStatusDetailsOptions)
216-
Expect(err).To(BeNil())
217-
Expect(response.StatusCode).To(Equal(200))
218-
Expect(projectStatusDetails).ToNot(BeNil())
219-
})
220-
})
221-
222206
Describe(`ListApps - List applications`, func() {
223207
BeforeEach(func() {
224208
shouldSkipTest()
@@ -1434,7 +1418,7 @@ var _ = Describe(`CodeEngineV2 Integration Tests`, func() {
14341418
It(`GetBinding(getBindingOptions *GetBindingOptions)`, func() {
14351419
getBindingOptions := &codeenginev2.GetBindingOptions{
14361420
ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"),
1437-
Name: core.StringPtr("app_my-app-1_my-service-access_PREFIX"),
1421+
ID: core.StringPtr("a172ced-b5f21bc-71ba50c-1638604"),
14381422
}
14391423

14401424
binding, response, err := codeEngineService.GetBinding(getBindingOptions)
@@ -1595,7 +1579,7 @@ var _ = Describe(`CodeEngineV2 Integration Tests`, func() {
15951579
It(`DeleteBinding(deleteBindingOptions *DeleteBindingOptions)`, func() {
15961580
deleteBindingOptions := &codeenginev2.DeleteBindingOptions{
15971581
ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"),
1598-
Name: core.StringPtr("app_my-app-1_my-service-access_PREFIX"),
1582+
ID: core.StringPtr("a172ced-b5f21bc-71ba50c-1638604"),
15991583
}
16001584

16011585
response, err := codeEngineService.DeleteBinding(deleteBindingOptions)

0 commit comments

Comments
 (0)