-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Orbital resources: bump API version from 2022-03-01 to 2022-11-01 #21405
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,9 @@ import ( | |
"time" | ||
|
||
"github.com/hashicorp/go-azure-helpers/lang/response" | ||
"github.com/hashicorp/go-azure-sdk/resource-manager/orbital/2022-03-01/contact" | ||
"github.com/hashicorp/go-azure-sdk/resource-manager/orbital/2022-03-01/contactprofile" | ||
"github.com/hashicorp/go-azure-sdk/resource-manager/orbital/2022-03-01/spacecraft" | ||
"github.com/hashicorp/go-azure-sdk/resource-manager/orbital/2022-11-01/contact" | ||
"github.com/hashicorp/go-azure-sdk/resource-manager/orbital/2022-11-01/contactprofile" | ||
"github.com/hashicorp/go-azure-sdk/resource-manager/orbital/2022-11-01/spacecraft" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk" | ||
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" | ||
|
@@ -112,7 +112,7 @@ func (r ContactResource) Create() sdk.ResourceFunc { | |
} | ||
|
||
contactProfile := contact.ResourceReference{ | ||
Id: &model.ContactProfileId, | ||
Id: model.ContactProfileId, | ||
} | ||
|
||
contactProperties := contact.ContactsProperties{ | ||
|
@@ -125,7 +125,7 @@ func (r ContactResource) Create() sdk.ResourceFunc { | |
contact := contact.Contact{ | ||
Id: utils.String(id.ID()), | ||
Name: utils.String(model.Name), | ||
Properties: &contactProperties, | ||
Properties: contactProperties, | ||
} | ||
if _, err = client.Create(ctx, id, contact); err != nil { | ||
return fmt.Errorf("creating %s: %+v", id, err) | ||
|
@@ -161,18 +161,28 @@ func (r ContactResource) Read() sdk.ResourceFunc { | |
Name: id.ContactName, | ||
Spacecraft: spacecraftId.ID(), | ||
} | ||
|
||
if props != nil { | ||
if props.ReservationStartTime != "" { | ||
state.ReservationStartTime = props.ReservationStartTime | ||
} else { | ||
return fmt.Errorf("contact profile reservation start time is missing %s", *id) | ||
} | ||
|
||
if props.ReservationEndTime != "" { | ||
state.ReservationEndTime = props.ReservationEndTime | ||
} else { | ||
return fmt.Errorf("contact profile reservation end time is missing %s", *id) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this returned as an error? this should be flagged as missing in the diff |
||
} | ||
|
||
if props.GroundStationName != "" { | ||
state.GroundStationName = props.GroundStationName | ||
if props.ContactProfile.Id != nil { | ||
state.ContactProfileId = *props.ContactProfile.Id | ||
} else { | ||
return fmt.Errorf("contact profile id is missing %s", *id) | ||
} | ||
} else { | ||
return fmt.Errorf("required properties are missing %s", *id) | ||
return fmt.Errorf("contact profile ground station name is missing %s", *id) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this returned as an error? this should be flagged as missing in the diff |
||
} | ||
|
||
if props.ContactProfile.Id != "" { | ||
state.ContactProfileId = props.ContactProfile.Id | ||
} else { | ||
return fmt.Errorf("contact profile id is missing %s", *id) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this returned as an error? this should be flagged as missing in the diff |
||
} | ||
|
||
return metadata.Encode(&state) | ||
|
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this returned as an error? this should be flagged as missing in the diff