Skip to content

Commit

Permalink
Merge pull request #40 from wcm-io-devops/feature/refactorModels2
Browse files Browse the repository at this point in the history
refactor: split models into separate files
  • Loading branch information
tobias-richter authored Oct 15, 2024
2 parents 149f662 + 7f0179a commit 59aa0e6
Show file tree
Hide file tree
Showing 21 changed files with 484 additions and 462 deletions.
2 changes: 1 addition & 1 deletion src/auth.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::client::CloudManagerClient;
use crate::config::{AuthStrategy, Scope};
use crate::models::{BearerResponse, JwtClaims};
use crate::models::auth::{BearerResponse, JwtClaims};
use crate::IMS_ENDPOINT;
use chrono::{Duration, Utc};
use jsonwebtoken::{encode, Algorithm, EncodingKey, Header};
Expand Down
7 changes: 4 additions & 3 deletions src/clap_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ use crate::client::CloudManagerClient;
use crate::config::CloudManagerConfig;
use crate::encryption::{decrypt, encrypt};
use crate::logs::{download_log, tail_log};
use crate::models::{
Domain, EnvironmentVariableServiceType, LogType, PipelineVariableServiceType, ServiceType,
};
use crate::models::domain::Domain;
use crate::models::log::{LogType, ServiceType};
use crate::models::variables::{EnvironmentVariableServiceType, PipelineVariableServiceType};

use crate::variables::{
get_env_vars, get_pipeline_vars, set_env_vars_from_file, set_pipeline_vars_from_file,
};
Expand Down
5 changes: 3 additions & 2 deletions src/domains.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::client::{AdobeConnector, CloudManagerClient};
use crate::errors::throw_adobe_api_error;
use crate::models::{CreateDomainResponse, DomainList, DomainResponse, MinimumDomain, YamlConfig};
use crate::models::config::YamlConfig;
use crate::models::domain::{CreateDomainResponse, DomainList, DomainResponse, MinimumDomain};
use crate::HOST_NAME;
extern crate uuid;
use colored::Colorize;
Expand Down Expand Up @@ -57,7 +58,7 @@ pub async fn create_domains(
process::exit(1);
});
let mut ret_value = 0;
let programs: Vec<crate::models::ProgramsConfig> = input.programs;
let programs: Vec<crate::models::config::ProgramsConfig> = input.programs;
for d in &programs {
println!("☁ Program: {}", d.id,);
if let Some(environments_vec) = &d.environments {
Expand Down
3 changes: 2 additions & 1 deletion src/environments.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::client::{AdobeConnector, CloudManagerClient};
use crate::errors::throw_adobe_api_error;
use crate::models::{Environment, EnvironmentsList, EnvironmentsResponse};
use crate::models::environment::{Environment, EnvironmentsList};
use crate::models::variables::EnvironmentsResponse;
use crate::HOST_NAME;
use reqwest::{Error, Method};
use std::process;
Expand Down
2 changes: 1 addition & 1 deletion src/execution.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::client::{AdobeConnector, CloudManagerClient};
use crate::errors::throw_adobe_api_error;
use crate::models::{ExecutionList, ExecutionResponse};
use crate::models::execution::{ExecutionList, ExecutionResponse};
use crate::HOST_NAME;
use reqwest::{Error, Method};
use std::process;
Expand Down
2 changes: 1 addition & 1 deletion src/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use reqwest::{Error, Method, StatusCode};

use crate::client::{AdobeConnector, CloudManagerClient};
use crate::errors::throw_adobe_api_error;
use crate::models::{LogTailResponse, LogType, ServiceType};
use crate::models::log::{LogTailResponse, LogType, ServiceType};
use crate::HOST_NAME;

/// Downloads the specified log.
Expand Down
Loading

0 comments on commit 59aa0e6

Please sign in to comment.