1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15+ use super :: security_scheme:: SecuritySchemeName ;
1516use crate :: base_model:: agent:: AgentTypeName ;
1617use crate :: base_model:: diff;
1718use crate :: base_model:: domain_registration:: Domain ;
1819use crate :: base_model:: environment:: EnvironmentId ;
1920use crate :: { declare_revision, declare_structs, newtype_uuid} ;
2021use chrono:: DateTime ;
21- use std:: collections:: BTreeSet ;
22+ use std:: collections:: BTreeMap ;
2223
2324newtype_uuid ! ( HttpApiDeploymentId ) ;
2425
2526declare_revision ! ( HttpApiDeploymentRevision ) ;
2627
2728declare_structs ! {
29+ #[ derive( Default ) ]
30+ #[ cfg_attr( feature = "full" , derive( desert_rust:: BinaryCodec ) ) ]
31+ #[ cfg_attr( feature = "full" , desert( transparent) ) ]
32+ pub struct HttpApiDeploymentAgentOptions {
33+ /// Security scheme to use for all agent methods that require auth.
34+ /// Failure to provide a security scheme for an agent that requires one will lead to a deployment failure.
35+ /// If the requested security scheme does not exist in the environment, the route will be disabled at runtime.
36+ pub security_scheme: Option <SecuritySchemeName >
37+ }
38+
2839 pub struct HttpApiDeploymentCreation {
2940 pub domain: Domain ,
30- pub agent_types : BTreeSet <AgentTypeName >
41+ pub agents : BTreeMap <AgentTypeName , HttpApiDeploymentAgentOptions >
3142 }
3243
3344 pub struct HttpApiDeploymentUpdate {
3445 pub current_revision: HttpApiDeploymentRevision ,
35- pub agent_types : Option <BTreeSet <AgentTypeName >>
46+ pub agents : Option <BTreeMap <AgentTypeName , HttpApiDeploymentAgentOptions >>
3647 }
3748
3849 pub struct HttpApiDeployment {
@@ -41,7 +52,7 @@ declare_structs! {
4152 pub environment_id: EnvironmentId ,
4253 pub domain: Domain ,
4354 pub hash: diff:: Hash ,
44- pub agent_types : BTreeSet <AgentTypeName >,
55+ pub agents : BTreeMap <AgentTypeName , HttpApiDeploymentAgentOptions >,
4556 pub created_at: DateTime <chrono:: Utc >,
4657 }
4758}
0 commit comments