Skip to content
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

Auto-commit patched spec to ensure changes are shown accurately #62

Merged
merged 3 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/auto-commit-client-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
git checkout ${GITHUB_REF##*/}
make docker_run
echo -e "Make execution completed."
git add spec/oas3.patched/.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to do this or #57? (or this now, 57 later)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should do this now, and maybe 57 later. Doing this now makes it easer to open & review spec update PRs: easier to open because all you have to do is update the spec/oas3.fetched directory, easier to review because the spec/oas3.patched directory will always be up-to-date, so it's easier to notice if the spec update had unintended consequences on the patching process.

git add equinix-openapi-metal/.
echo -e "\nGit status:"
echo `git status`
Expand Down
7 changes: 7 additions & 0 deletions equinix-openapi-metal/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14560,6 +14560,7 @@ components:
href: href
switch_uuid: switch_uuid
short_id: short_id
termination_time: 2000-01-23T04:56:07.000+00:00
provisionable: true
need_of_service: true
href: href
Expand Down Expand Up @@ -14975,6 +14976,10 @@ components:
description: "Switch short id. This can be used to determine if two devices\
\ are connected to the same switch, for example."
type: string
termination_time:
description: Expiration date for the reservation.
format: date-time
type: string
type: object
HardwareReservationList:
example:
Expand Down Expand Up @@ -15034,6 +15039,7 @@ components:
href: href
switch_uuid: switch_uuid
short_id: short_id
termination_time: 2000-01-23T04:56:07.000+00:00
provisionable: true
need_of_service: true
href: href
Expand Down Expand Up @@ -15448,6 +15454,7 @@ components:
href: href
switch_uuid: switch_uuid
short_id: short_id
termination_time: 2000-01-23T04:56:07.000+00:00
provisionable: true
need_of_service: true
href: href
Expand Down
1 change: 1 addition & 0 deletions equinix-openapi-metal/docs/HardwareReservation.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
|**shortId** | **String** | Short version of the ID. | [optional] |
|**spare** | **Boolean** | Whether the Hardware Reservation is a spare. Spare Hardware Reservations are used when a Hardware Reservations requires service from Equinix Metal | [optional] |
|**switchUuid** | **String** | Switch short id. This can be used to determine if two devices are connected to the same switch, for example. | [optional] |
|**terminationTime** | **OffsetDateTime** | Expiration date for the reservation. | [optional] |



Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ public class HardwareReservation {
@SerializedName(SERIALIZED_NAME_SWITCH_UUID)
private String switchUuid;

public static final String SERIALIZED_NAME_TERMINATION_TIME = "termination_time";
@SerializedName(SERIALIZED_NAME_TERMINATION_TIME)
private OffsetDateTime terminationTime;

public HardwareReservation() {
}

Expand Down Expand Up @@ -394,6 +398,28 @@ public void setSwitchUuid(String switchUuid) {
this.switchUuid = switchUuid;
}


public HardwareReservation terminationTime(OffsetDateTime terminationTime) {

this.terminationTime = terminationTime;
return this;
}

/**
* Expiration date for the reservation.
* @return terminationTime
**/
@javax.annotation.Nullable

public OffsetDateTime getTerminationTime() {
return terminationTime;
}


public void setTerminationTime(OffsetDateTime terminationTime) {
this.terminationTime = terminationTime;
}

/**
* A container for additional, undeclared properties.
* This is a holder for any undeclared properties as specified with
Expand Down Expand Up @@ -461,13 +487,14 @@ public boolean equals(Object o) {
Objects.equals(this.provisionable, hardwareReservation.provisionable) &&
Objects.equals(this.shortId, hardwareReservation.shortId) &&
Objects.equals(this.spare, hardwareReservation.spare) &&
Objects.equals(this.switchUuid, hardwareReservation.switchUuid)&&
Objects.equals(this.switchUuid, hardwareReservation.switchUuid) &&
Objects.equals(this.terminationTime, hardwareReservation.terminationTime)&&
Objects.equals(this.additionalProperties, hardwareReservation.additionalProperties);
}

@Override
public int hashCode() {
return Objects.hash(createdAt, customRate, device, facility, href, id, needOfService, plan, project, provisionable, shortId, spare, switchUuid, additionalProperties);
return Objects.hash(createdAt, customRate, device, facility, href, id, needOfService, plan, project, provisionable, shortId, spare, switchUuid, terminationTime, additionalProperties);
}

@Override
Expand All @@ -487,6 +514,7 @@ public String toString() {
sb.append(" shortId: ").append(toIndentedString(shortId)).append("\n");
sb.append(" spare: ").append(toIndentedString(spare)).append("\n");
sb.append(" switchUuid: ").append(toIndentedString(switchUuid)).append("\n");
sb.append(" terminationTime: ").append(toIndentedString(terminationTime)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
Expand Down Expand Up @@ -523,6 +551,7 @@ private String toIndentedString(Object o) {
openapiFields.add("short_id");
openapiFields.add("spare");
openapiFields.add("switch_uuid");
openapiFields.add("termination_time");

// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,12 @@ public void switchUuidTest() {
// TODO: test switchUuid
}

/**
* Test the property 'terminationTime'
*/
@Test
public void terminationTimeTest() {
// TODO: test terminationTime
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,8 @@ properties:
description: Switch short id. This can be used to determine if two devices are
connected to the same switch, for example.
type: string
termination_time:
description: Expiration date for the reservation.
format: date-time
type: string
type: object
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,8 @@ properties:
description: Switch short id. This can be used to determine if two devices are
connected to the same switch, for example.
type: string
termination_time:
description: Expiration date for the reservation.
format: date-time
type: string
type: object