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

Remove the various client traits #108

Merged
merged 1 commit into from
Dec 1, 2020
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
9 changes: 3 additions & 6 deletions sdk/cosmos/src/requests/create_collection_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,19 @@ impl<'a> CreateCollectionBuilder<'a, No, No, No, No> {
}
}

impl<'a, OfferSet, CollectionNameSet, IndexingPolicySet, PartitionKeySet> DatabaseClientRequired<'a>
for CreateCollectionBuilder<'a, OfferSet, CollectionNameSet, IndexingPolicySet, PartitionKeySet>
impl<'a, OfferSet, CollectionNameSet, IndexingPolicySet, PartitionKeySet>
CreateCollectionBuilder<'a, OfferSet, CollectionNameSet, IndexingPolicySet, PartitionKeySet>
where
OfferSet: ToAssign,
CollectionNameSet: ToAssign,
IndexingPolicySet: ToAssign,
PartitionKeySet: ToAssign,
{
fn database_client(&self) -> &'a DatabaseClient {
pub fn database_client(&self) -> &'a DatabaseClient {
self.database_client
}
}

//get mandatory no traits methods

//set mandatory no traits methods
impl<'a, CollectionNameSet, IndexingPolicySet, PartitionKeySet> OfferRequired
for CreateCollectionBuilder<'a, Yes, CollectionNameSet, IndexingPolicySet, PartitionKeySet>
where
Expand Down
7 changes: 2 additions & 5 deletions sdk/cosmos/src/requests/create_database_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,15 @@ impl<'a> CreateDatabaseBuilder<'a, No> {
}
}

impl<'a, DatabaseNameSet> CosmosClientRequired<'a> for CreateDatabaseBuilder<'a, DatabaseNameSet>
impl<'a, DatabaseNameSet> CreateDatabaseBuilder<'a, DatabaseNameSet>
where
DatabaseNameSet: ToAssign,
{
fn cosmos_client(&self) -> &'a CosmosClient {
pub fn cosmos_client(&self) -> &'a CosmosClient {
self.cosmos_client
}
}

//get mandatory no traits methods

//set mandatory no traits methods
impl<'a> DatabaseNameRequired<'a> for CreateDatabaseBuilder<'a, Yes> {
fn database_name(&self) -> &'a dyn DatabaseName {
self.database_name.unwrap()
Expand Down
8 changes: 2 additions & 6 deletions sdk/cosmos/src/requests/create_document_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,15 @@ impl<'a, 'b> CreateDocumentBuilder<'a, 'b, No> {
}
}

impl<'a, 'b, PartitionKeysSet> CollectionClientRequired<'a>
for CreateDocumentBuilder<'a, 'b, PartitionKeysSet>
impl<'a, 'b, PartitionKeysSet> CreateDocumentBuilder<'a, 'b, PartitionKeysSet>
where
PartitionKeysSet: ToAssign,
{
fn collection_client(&self) -> &'a CollectionClient {
pub fn collection_client(&self) -> &'a CollectionClient {
self.collection_client
}
}

//get mandatory no traits methods

//set mandatory no traits methods
impl<'a, 'b> PartitionKeysRequired<'b> for CreateDocumentBuilder<'a, 'b, Yes> {
fn partition_keys(&self) -> &'b PartitionKeys {
self.partition_keys.unwrap()
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/src/requests/create_or_replace_trigger_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ impl<'a> CreateOrReplaceTriggerBuilder<'a, No, No, No> {
}
}

impl<'a, TriggerOperationSet, TriggerTypeSet, BodySet> TriggerClientRequired<'a>
for CreateOrReplaceTriggerBuilder<'a, TriggerOperationSet, TriggerTypeSet, BodySet>
impl<'a, TriggerOperationSet, TriggerTypeSet, BodySet>
CreateOrReplaceTriggerBuilder<'a, TriggerOperationSet, TriggerTypeSet, BodySet>
where
TriggerOperationSet: ToAssign,
TriggerTypeSet: ToAssign,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ impl<'a, 'b> CreateOrReplaceUserDefinedFunctionBuilder<'a, 'b, No> {
}
}

impl<'a, 'b, BodySet> UserDefinedFunctionClientRequired<'a>
for CreateOrReplaceUserDefinedFunctionBuilder<'a, 'b, BodySet>
impl<'a, 'b, BodySet> CreateOrReplaceUserDefinedFunctionBuilder<'a, 'b, BodySet>
where
BodySet: ToAssign,
{
Expand Down
7 changes: 2 additions & 5 deletions sdk/cosmos/src/requests/create_permission_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,12 @@ impl<'a, 'b> CreatePermissionBuilder<'a, 'b> {
}
}

impl<'a, 'b> PermissionClientRequired<'a> for CreatePermissionBuilder<'a, 'b> {
fn permission_client(&self) -> &'a PermissionClient {
impl<'a, 'b> CreatePermissionBuilder<'a, 'b> {
pub fn permission_client(&self) -> &'a PermissionClient {
self.permission_client
}
}

//get mandatory no traits methods

//set mandatory no traits methods
impl<'a, 'b> ExpirySecondsOption for CreatePermissionBuilder<'a, 'b> {
fn expiry_seconds(&self) -> u64 {
self.expiry_seconds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,17 @@ impl<'a, 'b> CreateReferenceAttachmentBuilder<'a, 'b, No, No> {
}
}

impl<'a, 'b, ContentTypeSet, MediaSet> AttachmentClientRequired<'a>
for CreateReferenceAttachmentBuilder<'a, 'b, ContentTypeSet, MediaSet>
impl<'a, 'b, ContentTypeSet, MediaSet>
CreateReferenceAttachmentBuilder<'a, 'b, ContentTypeSet, MediaSet>
where
ContentTypeSet: ToAssign,
MediaSet: ToAssign,
{
fn attachment_client(&self) -> &'a AttachmentClient {
pub fn attachment_client(&self) -> &'a AttachmentClient {
self.attachment_client
}
}

//get mandatory no traits methods

//set mandatory no traits methods
impl<'a, 'b, MediaSet> ContentTypeRequired<'b>
for CreateReferenceAttachmentBuilder<'a, 'b, Yes, MediaSet>
where
Expand Down
8 changes: 2 additions & 6 deletions sdk/cosmos/src/requests/create_slug_attachment_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,16 @@ impl<'a, 'b> CreateSlugAttachmentBuilder<'a, 'b, No, No> {
}
}

impl<'a, 'b, BodySet, ContentTypeSet> AttachmentClientRequired<'a>
for CreateSlugAttachmentBuilder<'a, 'b, BodySet, ContentTypeSet>
impl<'a, 'b, BodySet, ContentTypeSet> CreateSlugAttachmentBuilder<'a, 'b, BodySet, ContentTypeSet>
where
BodySet: ToAssign,
ContentTypeSet: ToAssign,
{
fn attachment_client(&self) -> &'a AttachmentClient {
pub fn attachment_client(&self) -> &'a AttachmentClient {
self.attachment_client
}
}

//get mandatory no traits methods

//set mandatory no traits methods
impl<'a, 'b, ContentTypeSet> BodyRequired<'b>
for CreateSlugAttachmentBuilder<'a, 'b, Yes, ContentTypeSet>
where
Expand Down
3 changes: 1 addition & 2 deletions sdk/cosmos/src/requests/create_stored_procedure_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ impl<'a, 'b> CreateStoredProcedureBuilder<'a, 'b, No> {
}
}

impl<'a, 'b, BodySet> StoredProcedureClientRequired<'a>
for CreateStoredProcedureBuilder<'a, 'b, BodySet>
impl<'a, 'b, BodySet> CreateStoredProcedureBuilder<'a, 'b, BodySet>
where
BodySet: ToAssign,
{
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/src/requests/create_user_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ impl<'a, 'b> CreateUserBuilder<'a, 'b> {
}
}

impl<'a, 'b> UserClientRequired<'a> for CreateUserBuilder<'a, 'b> {
fn user_client(&self) -> &'a UserClient {
impl<'a, 'b> CreateUserBuilder<'a, 'b> {
pub fn user_client(&self) -> &'a UserClient {
self.user_client
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/src/requests/delete_attachment_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ impl<'a, 'b> DeleteAttachmentBuilder<'a, 'b> {
}
}

impl<'a, 'b> AttachmentClientRequired<'a> for DeleteAttachmentBuilder<'a, 'b> {
fn attachment_client(&self) -> &'a AttachmentClient {
impl<'a, 'b> DeleteAttachmentBuilder<'a, 'b> {
pub fn attachment_client(&self) -> &'a AttachmentClient {
self.attachment_client
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/src/requests/delete_collection_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ impl<'a> DeleteCollectionBuilder<'a> {
}
}

impl<'a> CollectionClientRequired<'a> for DeleteCollectionBuilder<'a> {
fn collection_client(&self) -> &'a CollectionClient {
impl<'a> DeleteCollectionBuilder<'a> {
pub fn collection_client(&self) -> &'a CollectionClient {
self.collection_client
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/src/requests/delete_database_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ impl<'a> DeleteDatabaseBuilder<'a> {
}
}

impl<'a> DatabaseClientRequired<'a> for DeleteDatabaseBuilder<'a> {
fn database_client(&self) -> &'a DatabaseClient {
impl<'a> DeleteDatabaseBuilder<'a> {
pub fn database_client(&self) -> &'a DatabaseClient {
self.database_client
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/src/requests/delete_document_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ impl<'a> DeleteDocumentBuilder<'a> {
}
}

impl<'a> DocumentClientRequired<'a> for DeleteDocumentBuilder<'a> {
fn document_client(&self) -> &'a DocumentClient {
impl<'a> DeleteDocumentBuilder<'a> {
pub fn document_client(&self) -> &'a DocumentClient {
self.document_client
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/src/requests/delete_permission_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ impl<'a, 'b> DeletePermissionsBuilder<'a, 'b> {
}
}

impl<'a, 'b> PermissionClientRequired<'a> for DeletePermissionsBuilder<'a, 'b> {
fn permission_client(&self) -> &'a PermissionClient {
impl<'a, 'b> DeletePermissionsBuilder<'a, 'b> {
pub fn permission_client(&self) -> &'a PermissionClient {
self.permission_client
}
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/cosmos/src/requests/delete_stored_procedure_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl<'a, 'b> DeleteStoredProcedureBuilder<'a, 'b> {
}
}

impl<'a, 'b> StoredProcedureClientRequired<'a> for DeleteStoredProcedureBuilder<'a, 'b> {
impl<'a, 'b> DeleteStoredProcedureBuilder<'a, 'b> {
fn stored_procedure_client(&self) -> &'a StoredProcedureClient {
self.stored_procedure_client
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/cosmos/src/requests/delete_trigger_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl<'a, 'b> DeleteTriggerBuilder<'a, 'b> {
}
}

impl<'a, 'b> TriggerClientRequired<'a> for DeleteTriggerBuilder<'a, 'b> {
impl<'a, 'b> DeleteTriggerBuilder<'a, 'b> {
fn trigger_client(&self) -> &'a TriggerClient {
self.trigger_client
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/src/requests/delete_user_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ impl<'a, 'b> DeleteUserBuilder<'a, 'b> {
}
}

impl<'a, 'b> UserClientRequired<'a> for DeleteUserBuilder<'a, 'b> {
fn user_client(&self) -> &'a UserClient {
impl<'a, 'b> DeleteUserBuilder<'a, 'b> {
pub fn user_client(&self) -> &'a UserClient {
self.user_client
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl<'a, 'b> DeleteUserDefinedFunctionBuilder<'a, 'b> {
}
}

impl<'a, 'b> UserDefinedFunctionClientRequired<'a> for DeleteUserDefinedFunctionBuilder<'a, 'b> {
impl<'a, 'b> DeleteUserDefinedFunctionBuilder<'a, 'b> {
fn user_defined_function_client(&self) -> &'a UserDefinedFunctionClient {
self.user_defined_function_client
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl<'a, 'b> ExecuteStoredProcedureBuilder<'a, 'b> {
}
}

impl<'a, 'b> StoredProcedureClientRequired<'a> for ExecuteStoredProcedureBuilder<'a, 'b> {
impl<'a, 'b> ExecuteStoredProcedureBuilder<'a, 'b> {
fn stored_procedure_client(&self) -> &'a StoredProcedureClient {
self.stored_procedure_client
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/src/requests/get_attachment_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ impl<'a, 'b> GetAttachmentBuilder<'a, 'b> {
}
}

impl<'a, 'b> AttachmentClientRequired<'a> for GetAttachmentBuilder<'a, 'b> {
fn attachment_client(&self) -> &'a AttachmentClient {
impl<'a, 'b> GetAttachmentBuilder<'a, 'b> {
pub fn attachment_client(&self) -> &'a AttachmentClient {
self.attachment_client
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/src/requests/get_collection_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ impl<'a> GetCollectionBuilder<'a> {
}
}

impl<'a> CollectionClientRequired<'a> for GetCollectionBuilder<'a> {
fn collection_client(&self) -> &'a CollectionClient {
impl<'a> GetCollectionBuilder<'a> {
pub fn collection_client(&self) -> &'a CollectionClient {
self.collection_client
}
}
Expand Down
7 changes: 2 additions & 5 deletions sdk/cosmos/src/requests/get_database_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ impl<'a, 'b> GetDatabaseBuilder<'a, 'b> {
}
}

impl<'a, 'b> DatabaseClientRequired<'a> for GetDatabaseBuilder<'a, 'b> {
fn database_client(&self) -> &'a DatabaseClient {
impl<'a, 'b> GetDatabaseBuilder<'a, 'b> {
pub fn database_client(&self) -> &'a DatabaseClient {
self.database_client
}
}

//get mandatory no traits methods

//set mandatory no traits methods
impl<'a, 'b> UserAgentOption<'b> for GetDatabaseBuilder<'a, 'b> {
fn user_agent(&self) -> Option<&'b str> {
self.user_agent
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/src/requests/get_document_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ impl<'a, 'b> GetDocumentBuilder<'a, 'b> {
}
}

impl<'a, 'b> DocumentClientRequired<'a> for GetDocumentBuilder<'a, 'b> {
fn document_client(&self) -> &'a DocumentClient {
impl<'a, 'b> GetDocumentBuilder<'a, 'b> {
pub fn document_client(&self) -> &'a DocumentClient {
self.document_client
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/src/requests/get_partition_key_ranges_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ impl<'a, 'b> GetPartitionKeyRangesBuilder<'a, 'b> {
}
}

impl<'a, 'b> CollectionClientRequired<'a> for GetPartitionKeyRangesBuilder<'a, 'b> {
fn collection_client(&self) -> &'a CollectionClient {
impl<'a, 'b> GetPartitionKeyRangesBuilder<'a, 'b> {
pub fn collection_client(&self) -> &'a CollectionClient {
self.collection_client
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/src/requests/get_permission_builer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ impl<'a, 'b> GetPermissionBuilder<'a, 'b> {
}
}

impl<'a, 'b> PermissionClientRequired<'a> for GetPermissionBuilder<'a, 'b> {
fn permission_client(&self) -> &'a PermissionClient {
impl<'a, 'b> GetPermissionBuilder<'a, 'b> {
pub fn permission_client(&self) -> &'a PermissionClient {
self.permission_client
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/src/requests/get_user_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ impl<'a, 'b> GetUserBuilder<'a, 'b> {
}
}

impl<'a, 'b> UserClientRequired<'a> for GetUserBuilder<'a, 'b> {
fn user_client(&self) -> &'a UserClient {
impl<'a, 'b> GetUserBuilder<'a, 'b> {
pub fn user_client(&self) -> &'a UserClient {
self.user_client
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/src/requests/list_attachments_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ impl<'a, 'b> ListAttachmentsBuilder<'a, 'b> {
}
}

impl<'a, 'b> DocumentClientRequired<'a> for ListAttachmentsBuilder<'a, 'b> {
impl<'a, 'b> ListAttachmentsBuilder<'a, 'b> {
#[inline]
fn document_client(&self) -> &'a DocumentClient {
pub fn document_client(&self) -> &'a DocumentClient {
self.document_client
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/src/requests/list_collections_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ impl<'a> ListCollectionsBuilder<'a> {
}
}

impl<'a> DatabaseClientRequired<'a> for ListCollectionsBuilder<'a> {
fn database_client(&self) -> &'a DatabaseClient {
impl<'a> ListCollectionsBuilder<'a> {
pub fn database_client(&self) -> &'a DatabaseClient {
self.database_client
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/src/requests/list_databases_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ impl<'a> ListDatabasesBuilder<'a> {
}
}

impl<'a> CosmosClientRequired<'a> for ListDatabasesBuilder<'a> {
fn cosmos_client(&self) -> &'a CosmosClient {
impl<'a> ListDatabasesBuilder<'a> {
pub fn cosmos_client(&self) -> &'a CosmosClient {
self.cosmos_client
}
}
Expand Down
Loading