diff --git a/api-client-spring-boot-autoconfigure/pom.xml b/api-client-spring-boot-autoconfigure/pom.xml index bb9c191..d0b1a1d 100644 --- a/api-client-spring-boot-autoconfigure/pom.xml +++ b/api-client-spring-boot-autoconfigure/pom.xml @@ -19,7 +19,7 @@ 2.8.6 11.1 4.9.1 - 0.3.1 + 0.4.0 false 1.18.20 diff --git a/api-client-spring-boot-starter-sample/pom.xml b/api-client-spring-boot-starter-sample/pom.xml index c199ca0..bf51d87 100644 --- a/api-client-spring-boot-starter-sample/pom.xml +++ b/api-client-spring-boot-starter-sample/pom.xml @@ -15,7 +15,7 @@ Demo project for Spring Boot 11 - 0.3.1 + 0.4.0 true diff --git a/api-client-spring-boot-starter-sample/src/test/java/org/azbuilder/api/client/sample/ApiClientStarterSampleApplicationTests.java b/api-client-spring-boot-starter-sample/src/test/java/org/azbuilder/api/client/sample/ApiClientStarterSampleApplicationTests.java index 87f8123..e844e8e 100644 --- a/api-client-spring-boot-starter-sample/src/test/java/org/azbuilder/api/client/sample/ApiClientStarterSampleApplicationTests.java +++ b/api-client-spring-boot-starter-sample/src/test/java/org/azbuilder/api/client/sample/ApiClientStarterSampleApplicationTests.java @@ -1,9 +1,8 @@ package org.azbuilder.api.client.sample; import org.azbuilder.api.client.model.organization.Organization; -import org.azbuilder.api.client.model.organization.job.Job; -import org.azbuilder.api.client.model.organization.job.JobRequest; -import org.azbuilder.api.client.model.organization.workspace.Workspace; +import org.azbuilder.api.client.model.organization.provider.version.Version; +import org.azbuilder.api.client.model.organization.provider.version.file.File; import org.azbuilder.api.client.model.response.Response; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -64,5 +63,34 @@ void contextLoads() { System.out.println(restClient.getModuleByNameAndProvider(organizationId, "azure","azurerm").getData().get(0).getAttributes().getSource()); */ +/* + Response> listResponse = + restClient.getOrganizationsByNameAndProvider("sampleOrg","sampleProvider"); + + System.out.println(listResponse.getData().get(0).getId()); + System.out.println(listResponse.getData().get(0).getRelationships().getProvider().getData().get(0).getId()); + + Response> listVersion = + restClient.getVersionsByOrganizationIdAndProviderIdAndVersionNumber( + listResponse.getData().get(0).getId(), + listResponse.getData().get(0).getRelationships().getProvider().getData().get(0).getId(), + "1"); + + + Response> files= restClient.getFileByOsArchVersion( + listResponse.getData().get(0).getId(), + listResponse.getData().get(0).getRelationships().getProvider().getData().get(0).getId(), + listVersion.getData().get(0).getId(), + "linux", + "amd64"); + + System.out.println(files.getData().get(0).getId()); + System.out.println(files.getData().get(0).getAttributes().getFilename()); + + + + System.out.println(restClient.getAllVersionsByProvider(listResponse.getData().get(0).getId(), + listResponse.getData().get(0).getRelationships().getProvider().getData().get(0).getId()).getIncluded().size());*/ + } } diff --git a/api-client-spring-boot-starter/pom.xml b/api-client-spring-boot-starter/pom.xml index 2013d1e..a1b20fc 100644 --- a/api-client-spring-boot-starter/pom.xml +++ b/api-client-spring-boot-starter/pom.xml @@ -13,7 +13,7 @@ UTF-8 - 0.3.1 + 0.4.0 false diff --git a/api-client/pom.xml b/api-client/pom.xml index f32e703..0e1e372 100644 --- a/api-client/pom.xml +++ b/api-client/pom.xml @@ -15,7 +15,7 @@ Demo project for Spring Boot 11 - 0.3.1 + 0.4.0 11.1 3.8.0 false diff --git a/api-client/src/main/java/org/azbuilder/api/client/RestClient.java b/api-client/src/main/java/org/azbuilder/api/client/RestClient.java index ffc473c..dcc0077 100644 --- a/api-client/src/main/java/org/azbuilder/api/client/RestClient.java +++ b/api-client/src/main/java/org/azbuilder/api/client/RestClient.java @@ -7,6 +7,8 @@ import org.azbuilder.api.client.model.organization.job.Job; import org.azbuilder.api.client.model.organization.job.JobRequest; import org.azbuilder.api.client.model.organization.module.Module; +import org.azbuilder.api.client.model.organization.provider.version.Version; +import org.azbuilder.api.client.model.organization.provider.version.file.File; import org.azbuilder.api.client.model.organization.workspace.Workspace; import org.azbuilder.api.client.model.organization.workspace.environment.Environment; import org.azbuilder.api.client.model.organization.workspace.secret.Secret; @@ -61,5 +63,16 @@ public interface RestClient { @RequestLine("GET /api/v1/organization/{organizationId}/module?filter[module]=name=={moduleName};provider=={providerName}") Response> getModuleByNameAndProvider(@Param("organizationId") String organizationId, @Param("moduleName") String moduleName, @Param("providerName") String providerName); + @RequestLine("GET /api/v1/organization?filter[organization]=name=={organizationName}&filter[provider]=name=={providerName}") + Response> getOrganizationsByNameAndProvider(@Param("organizationName") String organizationName, @Param("providerName") String providerName); + + @RequestLine("GET /api/v1/organization/{organizationId}/provider/{providerId}/version?include=file") + ResponseWithInclude, File> getAllVersionsByProviderWithFile(@Param("organizationId") String organizationId, @Param("providerId") String providerId); + + @RequestLine("GET /api/v1/organization/{organizationId}/provider/{providerId}/version?filter[version]=versionNumber=={versionNumber}") + Response> getVersionsByOrganizationIdAndProviderIdAndVersionNumber(@Param("organizationId") String organizationId, @Param("providerId") String providerId, @Param("versionNumber") String versionNumber); + + @RequestLine("GET /api/v1/organization/{organizationId}/provider/{providerId}/version/{versionId}/file?filter[file]=os=={os};arch=={arch}") + Response> getFileByOsArchVersion(@Param("organizationId") String organizationId, @Param("providerId") String providerId, @Param("versionId") String versionId, @Param("os") String os, @Param("arch") String arch); } diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/ProviderData.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/ProviderData.java new file mode 100644 index 0000000..4932bb0 --- /dev/null +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/ProviderData.java @@ -0,0 +1,13 @@ +package org.azbuilder.api.client.model.organization; + +import lombok.Getter; +import lombok.Setter; +import org.azbuilder.api.client.model.generic.Resource; + +import java.util.List; + +@Getter +@Setter +public class ProviderData { + List data; +} diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/Relationships.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/Relationships.java index bfd028e..9fdde9a 100644 --- a/api-client/src/main/java/org/azbuilder/api/client/model/organization/Relationships.java +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/Relationships.java @@ -9,4 +9,5 @@ public class Relationships { JobData job; ModuleData module; WorkspaceData workspace; + ProviderData provider; } diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/OrganizationData.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/OrganizationData.java new file mode 100644 index 0000000..52788c2 --- /dev/null +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/OrganizationData.java @@ -0,0 +1,11 @@ +package org.azbuilder.api.client.model.organization.provider; + +import lombok.Getter; +import lombok.Setter; +import org.azbuilder.api.client.model.generic.Resource; + +@Getter +@Setter +public class OrganizationData { + Resource data; +} diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/Provider.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/Provider.java new file mode 100644 index 0000000..88c00e7 --- /dev/null +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/Provider.java @@ -0,0 +1,12 @@ +package org.azbuilder.api.client.model.organization.provider; + +import lombok.Getter; +import lombok.Setter; +import org.azbuilder.api.client.model.generic.Resource; + +@Getter +@Setter +public class Provider extends Resource { + ProviderAttributes attributes; + Relationships relationships; +} diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/ProviderAttributes.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/ProviderAttributes.java new file mode 100644 index 0000000..379251b --- /dev/null +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/ProviderAttributes.java @@ -0,0 +1,11 @@ +package org.azbuilder.api.client.model.organization.provider; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class ProviderAttributes { + private String name; + private String description; +} diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/Relationships.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/Relationships.java new file mode 100644 index 0000000..65475c6 --- /dev/null +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/Relationships.java @@ -0,0 +1,11 @@ +package org.azbuilder.api.client.model.organization.provider; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class Relationships { + OrganizationData organization; + VersionData version; +} diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/VersionData.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/VersionData.java new file mode 100644 index 0000000..975fb89 --- /dev/null +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/VersionData.java @@ -0,0 +1,13 @@ +package org.azbuilder.api.client.model.organization.provider; + +import lombok.Getter; +import lombok.Setter; +import org.azbuilder.api.client.model.generic.Resource; + +import java.util.List; + +@Getter +@Setter +public class VersionData { + List data; +} diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/FileData.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/FileData.java new file mode 100644 index 0000000..4bded2a --- /dev/null +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/FileData.java @@ -0,0 +1,13 @@ +package org.azbuilder.api.client.model.organization.provider.version; + +import lombok.Getter; +import lombok.Setter; +import org.azbuilder.api.client.model.generic.Resource; + +import java.util.List; + +@Getter +@Setter +public class FileData { + List data; +} diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/ProviderData.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/ProviderData.java new file mode 100644 index 0000000..4dbebfa --- /dev/null +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/ProviderData.java @@ -0,0 +1,11 @@ +package org.azbuilder.api.client.model.organization.provider.version; + +import lombok.Getter; +import lombok.Setter; +import org.azbuilder.api.client.model.generic.Resource; + +@Getter +@Setter +public class ProviderData { + Resource data; +} diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/Relationships.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/Relationships.java new file mode 100644 index 0000000..cb653a5 --- /dev/null +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/Relationships.java @@ -0,0 +1,11 @@ +package org.azbuilder.api.client.model.organization.provider.version; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class Relationships { + FileData file; + ProviderData provider; +} diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/Version.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/Version.java new file mode 100644 index 0000000..9c3a25f --- /dev/null +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/Version.java @@ -0,0 +1,12 @@ +package org.azbuilder.api.client.model.organization.provider.version; + +import lombok.Getter; +import lombok.Setter; +import org.azbuilder.api.client.model.generic.Resource; + +@Getter +@Setter +public class Version extends Resource { + VersionAttributes attributes; + Relationships relationships; +} diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/VersionAttributes.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/VersionAttributes.java new file mode 100644 index 0000000..a565680 --- /dev/null +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/VersionAttributes.java @@ -0,0 +1,11 @@ +package org.azbuilder.api.client.model.organization.provider.version; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class VersionAttributes { + private String versionNumber; + private String protocols; +} diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/File.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/File.java new file mode 100644 index 0000000..b7dbaad --- /dev/null +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/File.java @@ -0,0 +1,12 @@ +package org.azbuilder.api.client.model.organization.provider.version.file; + +import lombok.Getter; +import lombok.Setter; +import org.azbuilder.api.client.model.generic.Resource; + +@Getter +@Setter +public class File extends Resource { + FileAttributes attributes; + Relationships relationships; +} diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/FileAttributes.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/FileAttributes.java new file mode 100644 index 0000000..d006e90 --- /dev/null +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/FileAttributes.java @@ -0,0 +1,21 @@ +package org.azbuilder.api.client.model.organization.provider.version.file; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class FileAttributes { + private String os; + private String arch; + private String filename; + private String downloadUrl; + private String shasumsUrl; + private String shasumsSignatureUrl; + private String shasum; + private String keyId; + private String asciiArmor; + private String trustSignature; + private String source; + private String sourceUrl; +} diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/Relationships.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/Relationships.java new file mode 100644 index 0000000..ce5d8bc --- /dev/null +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/Relationships.java @@ -0,0 +1,10 @@ +package org.azbuilder.api.client.model.organization.provider.version.file; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class Relationships { + VersionData version; +} diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/VersionData.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/VersionData.java new file mode 100644 index 0000000..1abaaeb --- /dev/null +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/VersionData.java @@ -0,0 +1,11 @@ +package org.azbuilder.api.client.model.organization.provider.version.file; + +import lombok.Getter; +import lombok.Setter; +import org.azbuilder.api.client.model.generic.Resource; + +@Getter +@Setter +public class VersionData { + Resource data; +}