rapidata 1.2.1__py3-none-any.whl → 1.2.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. rapidata/__init__.py +4 -0
  2. rapidata/api_client/__init__.py +4 -0
  3. rapidata/api_client/api/identity_api.py +289 -11
  4. rapidata/api_client/models/__init__.py +4 -0
  5. rapidata/api_client/models/add_validation_text_rapid_model.py +3 -3
  6. rapidata/api_client/models/create_client_model.py +9 -6
  7. rapidata/api_client/models/create_client_result.py +89 -0
  8. rapidata/api_client/models/create_complex_order_result.py +6 -1
  9. rapidata/api_client/models/create_legacy_client_model.py +89 -0
  10. rapidata/api_client/models/create_order_model_workflow.py +24 -10
  11. rapidata/api_client/models/evaluation_workflow_config.py +102 -0
  12. rapidata/api_client/models/evaluation_workflow_model.py +96 -0
  13. rapidata/api_client/models/workflow_config_artifact_model_workflow_config.py +23 -9
  14. rapidata/api_client_README.md +6 -1
  15. rapidata/rapidata_client/__init__.py +10 -0
  16. rapidata/rapidata_client/dataset/rapidata_validation_set.py +26 -6
  17. rapidata/rapidata_client/dataset/validation_set_builder.py +1 -1
  18. rapidata/rapidata_client/filter/__init__.py +7 -0
  19. rapidata/rapidata_client/filter/age_filter.py +16 -0
  20. rapidata/rapidata_client/filter/base_filter.py +9 -0
  21. rapidata/rapidata_client/filter/campaign_filter.py +17 -0
  22. rapidata/rapidata_client/filter/country_filter.py +16 -0
  23. rapidata/rapidata_client/filter/gender_filter.py +16 -0
  24. rapidata/rapidata_client/filter/language_filter.py +18 -0
  25. rapidata/rapidata_client/filter/user_score_filter.py +19 -0
  26. rapidata/rapidata_client/order/rapidata_order_builder.py +84 -56
  27. {rapidata-1.2.1.dist-info → rapidata-1.2.3.dist-info}/METADATA +1 -1
  28. {rapidata-1.2.1.dist-info → rapidata-1.2.3.dist-info}/RECORD +30 -18
  29. {rapidata-1.2.1.dist-info → rapidata-1.2.3.dist-info}/LICENSE +0 -0
  30. {rapidata-1.2.1.dist-info → rapidata-1.2.3.dist-info}/WHEEL +0 -0
rapidata/__init__.py CHANGED
@@ -20,4 +20,8 @@ from .rapidata_client import (
20
20
  MediaAsset,
21
21
  TextAsset,
22
22
  MultiAsset,
23
+ CountryFilter,
24
+ LanguageFilter,
25
+ UserScoreFilter,
26
+ CampaignFilter,
23
27
  )
@@ -99,6 +99,7 @@ from rapidata.api_client.models.count_metadata import CountMetadata
99
99
  from rapidata.api_client.models.count_metadata_model import CountMetadataModel
100
100
  from rapidata.api_client.models.country_user_filter_model import CountryUserFilterModel
101
101
  from rapidata.api_client.models.create_client_model import CreateClientModel
102
+ from rapidata.api_client.models.create_client_result import CreateClientResult
102
103
  from rapidata.api_client.models.create_complex_order_model import CreateComplexOrderModel
103
104
  from rapidata.api_client.models.create_complex_order_model_pipeline import CreateComplexOrderModelPipeline
104
105
  from rapidata.api_client.models.create_complex_order_result import CreateComplexOrderResult
@@ -106,6 +107,7 @@ from rapidata.api_client.models.create_dataset_artifact_model import CreateDatas
106
107
  from rapidata.api_client.models.create_dataset_artifact_model_dataset import CreateDatasetArtifactModelDataset
107
108
  from rapidata.api_client.models.create_demographic_rapid_model import CreateDemographicRapidModel
108
109
  from rapidata.api_client.models.create_empty_validation_set_result import CreateEmptyValidationSetResult
110
+ from rapidata.api_client.models.create_legacy_client_model import CreateLegacyClientModel
109
111
  from rapidata.api_client.models.create_order_model import CreateOrderModel
110
112
  from rapidata.api_client.models.create_order_model_referee import CreateOrderModelReferee
111
113
  from rapidata.api_client.models.create_order_model_user_filters_inner import CreateOrderModelUserFiltersInner
@@ -131,6 +133,8 @@ from rapidata.api_client.models.demographic_selection import DemographicSelectio
131
133
  from rapidata.api_client.models.early_stopping_referee_model import EarlyStoppingRefereeModel
132
134
  from rapidata.api_client.models.empty_validation_truth import EmptyValidationTruth
133
135
  from rapidata.api_client.models.error_type import ErrorType
136
+ from rapidata.api_client.models.evaluation_workflow_config import EvaluationWorkflowConfig
137
+ from rapidata.api_client.models.evaluation_workflow_model import EvaluationWorkflowModel
134
138
  from rapidata.api_client.models.feature_flag import FeatureFlag
135
139
  from rapidata.api_client.models.feature_flag_model import FeatureFlagModel
136
140
  from rapidata.api_client.models.feedback_model import FeedbackModel
@@ -20,6 +20,8 @@ from pydantic import Field, StrictStr
20
20
  from typing import Optional
21
21
  from typing_extensions import Annotated
22
22
  from rapidata.api_client.models.create_client_model import CreateClientModel
23
+ from rapidata.api_client.models.create_client_result import CreateClientResult
24
+ from rapidata.api_client.models.create_legacy_client_model import CreateLegacyClientModel
23
25
  from rapidata.api_client.models.issue_auth_token_result import IssueAuthTokenResult
24
26
  from rapidata.api_client.models.legacy_issue_client_auth_token_result import LegacyIssueClientAuthTokenResult
25
27
  from rapidata.api_client.models.legacy_request_password_reset_command import LegacyRequestPasswordResetCommand
@@ -333,10 +335,9 @@ class IdentityApi:
333
335
  _content_type: Optional[StrictStr] = None,
334
336
  _headers: Optional[Dict[StrictStr, Any]] = None,
335
337
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
336
- ) -> None:
337
- """Creates a new client for a customer.
338
+ ) -> CreateClientResult:
339
+ """Creates a new client for the current customer.
338
340
 
339
- A client represents an application or project that a customer might use to access the API. The clients are used for machine-to-machine communication.
340
341
 
341
342
  :param create_client_model: The model for creating a new client.
342
343
  :type create_client_model: CreateClientModel
@@ -371,7 +372,7 @@ class IdentityApi:
371
372
  )
372
373
 
373
374
  _response_types_map: Dict[str, Optional[str]] = {
374
- '200': None,
375
+ '200': "CreateClientResult",
375
376
  }
376
377
  response_data = self.api_client.call_api(
377
378
  *_param,
@@ -400,10 +401,9 @@ class IdentityApi:
400
401
  _content_type: Optional[StrictStr] = None,
401
402
  _headers: Optional[Dict[StrictStr, Any]] = None,
402
403
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
403
- ) -> ApiResponse[None]:
404
- """Creates a new client for a customer.
404
+ ) -> ApiResponse[CreateClientResult]:
405
+ """Creates a new client for the current customer.
405
406
 
406
- A client represents an application or project that a customer might use to access the API. The clients are used for machine-to-machine communication.
407
407
 
408
408
  :param create_client_model: The model for creating a new client.
409
409
  :type create_client_model: CreateClientModel
@@ -438,7 +438,7 @@ class IdentityApi:
438
438
  )
439
439
 
440
440
  _response_types_map: Dict[str, Optional[str]] = {
441
- '200': None,
441
+ '200': "CreateClientResult",
442
442
  }
443
443
  response_data = self.api_client.call_api(
444
444
  *_param,
@@ -468,9 +468,8 @@ class IdentityApi:
468
468
  _headers: Optional[Dict[StrictStr, Any]] = None,
469
469
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
470
470
  ) -> RESTResponseType:
471
- """Creates a new client for a customer.
471
+ """Creates a new client for the current customer.
472
472
 
473
- A client represents an application or project that a customer might use to access the API. The clients are used for machine-to-machine communication.
474
473
 
475
474
  :param create_client_model: The model for creating a new client.
476
475
  :type create_client_model: CreateClientModel
@@ -505,7 +504,7 @@ class IdentityApi:
505
504
  )
506
505
 
507
506
  _response_types_map: Dict[str, Optional[str]] = {
508
- '200': None,
507
+ '200': "CreateClientResult",
509
508
  }
510
509
  response_data = self.api_client.call_api(
511
510
  *_param,
@@ -546,6 +545,15 @@ class IdentityApi:
546
545
  _body_params = create_client_model
547
546
 
548
547
 
548
+ # set the HTTP header `Accept`
549
+ if 'Accept' not in _header_params:
550
+ _header_params['Accept'] = self.api_client.select_header_accept(
551
+ [
552
+ 'text/plain',
553
+ 'application/json',
554
+ 'text/json'
555
+ ]
556
+ )
549
557
 
550
558
  # set the HTTP header `Content-Type`
551
559
  if _content_type:
@@ -587,6 +595,276 @@ class IdentityApi:
587
595
 
588
596
 
589
597
 
598
+ @validate_call
599
+ def identity_create_legacy_client_post(
600
+ self,
601
+ create_legacy_client_model: Annotated[Optional[CreateLegacyClientModel], Field(description="The model for creating a new client.")] = None,
602
+ _request_timeout: Union[
603
+ None,
604
+ Annotated[StrictFloat, Field(gt=0)],
605
+ Tuple[
606
+ Annotated[StrictFloat, Field(gt=0)],
607
+ Annotated[StrictFloat, Field(gt=0)]
608
+ ]
609
+ ] = None,
610
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
611
+ _content_type: Optional[StrictStr] = None,
612
+ _headers: Optional[Dict[StrictStr, Any]] = None,
613
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
614
+ ) -> None:
615
+ """Creates a new client for a customer.
616
+
617
+ A client represents an application or project that a customer might use to access the API. The clients are used for machine-to-machine communication.
618
+
619
+ :param create_legacy_client_model: The model for creating a new client.
620
+ :type create_legacy_client_model: CreateLegacyClientModel
621
+ :param _request_timeout: timeout setting for this request. If one
622
+ number provided, it will be total request
623
+ timeout. It can also be a pair (tuple) of
624
+ (connection, read) timeouts.
625
+ :type _request_timeout: int, tuple(int, int), optional
626
+ :param _request_auth: set to override the auth_settings for an a single
627
+ request; this effectively ignores the
628
+ authentication in the spec for a single request.
629
+ :type _request_auth: dict, optional
630
+ :param _content_type: force content-type for the request.
631
+ :type _content_type: str, Optional
632
+ :param _headers: set to override the headers for a single
633
+ request; this effectively ignores the headers
634
+ in the spec for a single request.
635
+ :type _headers: dict, optional
636
+ :param _host_index: set to override the host_index for a single
637
+ request; this effectively ignores the host_index
638
+ in the spec for a single request.
639
+ :type _host_index: int, optional
640
+ :return: Returns the result object.
641
+ """ # noqa: E501
642
+
643
+ _param = self._identity_create_legacy_client_post_serialize(
644
+ create_legacy_client_model=create_legacy_client_model,
645
+ _request_auth=_request_auth,
646
+ _content_type=_content_type,
647
+ _headers=_headers,
648
+ _host_index=_host_index
649
+ )
650
+
651
+ _response_types_map: Dict[str, Optional[str]] = {
652
+ '200': None,
653
+ }
654
+ response_data = self.api_client.call_api(
655
+ *_param,
656
+ _request_timeout=_request_timeout
657
+ )
658
+ response_data.read()
659
+ return self.api_client.response_deserialize(
660
+ response_data=response_data,
661
+ response_types_map=_response_types_map,
662
+ ).data
663
+
664
+
665
+ @validate_call
666
+ def identity_create_legacy_client_post_with_http_info(
667
+ self,
668
+ create_legacy_client_model: Annotated[Optional[CreateLegacyClientModel], Field(description="The model for creating a new client.")] = None,
669
+ _request_timeout: Union[
670
+ None,
671
+ Annotated[StrictFloat, Field(gt=0)],
672
+ Tuple[
673
+ Annotated[StrictFloat, Field(gt=0)],
674
+ Annotated[StrictFloat, Field(gt=0)]
675
+ ]
676
+ ] = None,
677
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
678
+ _content_type: Optional[StrictStr] = None,
679
+ _headers: Optional[Dict[StrictStr, Any]] = None,
680
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
681
+ ) -> ApiResponse[None]:
682
+ """Creates a new client for a customer.
683
+
684
+ A client represents an application or project that a customer might use to access the API. The clients are used for machine-to-machine communication.
685
+
686
+ :param create_legacy_client_model: The model for creating a new client.
687
+ :type create_legacy_client_model: CreateLegacyClientModel
688
+ :param _request_timeout: timeout setting for this request. If one
689
+ number provided, it will be total request
690
+ timeout. It can also be a pair (tuple) of
691
+ (connection, read) timeouts.
692
+ :type _request_timeout: int, tuple(int, int), optional
693
+ :param _request_auth: set to override the auth_settings for an a single
694
+ request; this effectively ignores the
695
+ authentication in the spec for a single request.
696
+ :type _request_auth: dict, optional
697
+ :param _content_type: force content-type for the request.
698
+ :type _content_type: str, Optional
699
+ :param _headers: set to override the headers for a single
700
+ request; this effectively ignores the headers
701
+ in the spec for a single request.
702
+ :type _headers: dict, optional
703
+ :param _host_index: set to override the host_index for a single
704
+ request; this effectively ignores the host_index
705
+ in the spec for a single request.
706
+ :type _host_index: int, optional
707
+ :return: Returns the result object.
708
+ """ # noqa: E501
709
+
710
+ _param = self._identity_create_legacy_client_post_serialize(
711
+ create_legacy_client_model=create_legacy_client_model,
712
+ _request_auth=_request_auth,
713
+ _content_type=_content_type,
714
+ _headers=_headers,
715
+ _host_index=_host_index
716
+ )
717
+
718
+ _response_types_map: Dict[str, Optional[str]] = {
719
+ '200': None,
720
+ }
721
+ response_data = self.api_client.call_api(
722
+ *_param,
723
+ _request_timeout=_request_timeout
724
+ )
725
+ response_data.read()
726
+ return self.api_client.response_deserialize(
727
+ response_data=response_data,
728
+ response_types_map=_response_types_map,
729
+ )
730
+
731
+
732
+ @validate_call
733
+ def identity_create_legacy_client_post_without_preload_content(
734
+ self,
735
+ create_legacy_client_model: Annotated[Optional[CreateLegacyClientModel], Field(description="The model for creating a new client.")] = None,
736
+ _request_timeout: Union[
737
+ None,
738
+ Annotated[StrictFloat, Field(gt=0)],
739
+ Tuple[
740
+ Annotated[StrictFloat, Field(gt=0)],
741
+ Annotated[StrictFloat, Field(gt=0)]
742
+ ]
743
+ ] = None,
744
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
745
+ _content_type: Optional[StrictStr] = None,
746
+ _headers: Optional[Dict[StrictStr, Any]] = None,
747
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
748
+ ) -> RESTResponseType:
749
+ """Creates a new client for a customer.
750
+
751
+ A client represents an application or project that a customer might use to access the API. The clients are used for machine-to-machine communication.
752
+
753
+ :param create_legacy_client_model: The model for creating a new client.
754
+ :type create_legacy_client_model: CreateLegacyClientModel
755
+ :param _request_timeout: timeout setting for this request. If one
756
+ number provided, it will be total request
757
+ timeout. It can also be a pair (tuple) of
758
+ (connection, read) timeouts.
759
+ :type _request_timeout: int, tuple(int, int), optional
760
+ :param _request_auth: set to override the auth_settings for an a single
761
+ request; this effectively ignores the
762
+ authentication in the spec for a single request.
763
+ :type _request_auth: dict, optional
764
+ :param _content_type: force content-type for the request.
765
+ :type _content_type: str, Optional
766
+ :param _headers: set to override the headers for a single
767
+ request; this effectively ignores the headers
768
+ in the spec for a single request.
769
+ :type _headers: dict, optional
770
+ :param _host_index: set to override the host_index for a single
771
+ request; this effectively ignores the host_index
772
+ in the spec for a single request.
773
+ :type _host_index: int, optional
774
+ :return: Returns the result object.
775
+ """ # noqa: E501
776
+
777
+ _param = self._identity_create_legacy_client_post_serialize(
778
+ create_legacy_client_model=create_legacy_client_model,
779
+ _request_auth=_request_auth,
780
+ _content_type=_content_type,
781
+ _headers=_headers,
782
+ _host_index=_host_index
783
+ )
784
+
785
+ _response_types_map: Dict[str, Optional[str]] = {
786
+ '200': None,
787
+ }
788
+ response_data = self.api_client.call_api(
789
+ *_param,
790
+ _request_timeout=_request_timeout
791
+ )
792
+ return response_data.response
793
+
794
+
795
+ def _identity_create_legacy_client_post_serialize(
796
+ self,
797
+ create_legacy_client_model,
798
+ _request_auth,
799
+ _content_type,
800
+ _headers,
801
+ _host_index,
802
+ ) -> RequestSerialized:
803
+
804
+ _host = None
805
+
806
+ _collection_formats: Dict[str, str] = {
807
+ }
808
+
809
+ _path_params: Dict[str, str] = {}
810
+ _query_params: List[Tuple[str, str]] = []
811
+ _header_params: Dict[str, Optional[str]] = _headers or {}
812
+ _form_params: List[Tuple[str, str]] = []
813
+ _files: Dict[
814
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
815
+ ] = {}
816
+ _body_params: Optional[bytes] = None
817
+
818
+ # process the path parameters
819
+ # process the query parameters
820
+ # process the header parameters
821
+ # process the form parameters
822
+ # process the body parameter
823
+ if create_legacy_client_model is not None:
824
+ _body_params = create_legacy_client_model
825
+
826
+
827
+
828
+ # set the HTTP header `Content-Type`
829
+ if _content_type:
830
+ _header_params['Content-Type'] = _content_type
831
+ else:
832
+ _default_content_type = (
833
+ self.api_client.select_header_content_type(
834
+ [
835
+ 'application/json',
836
+ 'text/json',
837
+ 'application/*+json'
838
+ ]
839
+ )
840
+ )
841
+ if _default_content_type is not None:
842
+ _header_params['Content-Type'] = _default_content_type
843
+
844
+ # authentication setting
845
+ _auth_settings: List[str] = [
846
+ 'bearer',
847
+ 'oauth2'
848
+ ]
849
+
850
+ return self.api_client.param_serialize(
851
+ method='POST',
852
+ resource_path='/Identity/CreateLegacyClient',
853
+ path_params=_path_params,
854
+ query_params=_query_params,
855
+ header_params=_header_params,
856
+ body=_body_params,
857
+ post_params=_form_params,
858
+ files=_files,
859
+ auth_settings=_auth_settings,
860
+ collection_formats=_collection_formats,
861
+ _host=_host,
862
+ _request_auth=_request_auth
863
+ )
864
+
865
+
866
+
867
+
590
868
  @validate_call
591
869
  def identity_external_login_callback_get(
592
870
  self,
@@ -68,6 +68,7 @@ from rapidata.api_client.models.count_metadata import CountMetadata
68
68
  from rapidata.api_client.models.count_metadata_model import CountMetadataModel
69
69
  from rapidata.api_client.models.country_user_filter_model import CountryUserFilterModel
70
70
  from rapidata.api_client.models.create_client_model import CreateClientModel
71
+ from rapidata.api_client.models.create_client_result import CreateClientResult
71
72
  from rapidata.api_client.models.create_complex_order_model import CreateComplexOrderModel
72
73
  from rapidata.api_client.models.create_complex_order_model_pipeline import CreateComplexOrderModelPipeline
73
74
  from rapidata.api_client.models.create_complex_order_result import CreateComplexOrderResult
@@ -75,6 +76,7 @@ from rapidata.api_client.models.create_dataset_artifact_model import CreateDatas
75
76
  from rapidata.api_client.models.create_dataset_artifact_model_dataset import CreateDatasetArtifactModelDataset
76
77
  from rapidata.api_client.models.create_demographic_rapid_model import CreateDemographicRapidModel
77
78
  from rapidata.api_client.models.create_empty_validation_set_result import CreateEmptyValidationSetResult
79
+ from rapidata.api_client.models.create_legacy_client_model import CreateLegacyClientModel
78
80
  from rapidata.api_client.models.create_order_model import CreateOrderModel
79
81
  from rapidata.api_client.models.create_order_model_referee import CreateOrderModelReferee
80
82
  from rapidata.api_client.models.create_order_model_user_filters_inner import CreateOrderModelUserFiltersInner
@@ -100,6 +102,8 @@ from rapidata.api_client.models.demographic_selection import DemographicSelectio
100
102
  from rapidata.api_client.models.early_stopping_referee_model import EarlyStoppingRefereeModel
101
103
  from rapidata.api_client.models.empty_validation_truth import EmptyValidationTruth
102
104
  from rapidata.api_client.models.error_type import ErrorType
105
+ from rapidata.api_client.models.evaluation_workflow_config import EvaluationWorkflowConfig
106
+ from rapidata.api_client.models.evaluation_workflow_model import EvaluationWorkflowModel
103
107
  from rapidata.api_client.models.feature_flag import FeatureFlag
104
108
  from rapidata.api_client.models.feature_flag_model import FeatureFlagModel
105
109
  from rapidata.api_client.models.feedback_model import FeedbackModel
@@ -33,9 +33,9 @@ class AddValidationTextRapidModel(BaseModel):
33
33
  payload: AddValidationRapidModelPayload
34
34
  metadata: List[DatapointMetadataModelMetadataInner] = Field(description="Some metadata to attach to the rapid.")
35
35
  truth: AddValidationRapidModelTruth
36
- text: StrictStr
36
+ texts: List[StrictStr]
37
37
  random_correct_probability: Optional[Union[StrictFloat, StrictInt]] = Field(description="The probability for an answer to be correct when randomly guessing.", alias="randomCorrectProbability")
38
- __properties: ClassVar[List[str]] = ["validationSetId", "payload", "metadata", "truth", "text", "randomCorrectProbability"]
38
+ __properties: ClassVar[List[str]] = ["validationSetId", "payload", "metadata", "truth", "texts", "randomCorrectProbability"]
39
39
 
40
40
  model_config = ConfigDict(
41
41
  populate_by_name=True,
@@ -110,7 +110,7 @@ class AddValidationTextRapidModel(BaseModel):
110
110
  "payload": AddValidationRapidModelPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
111
111
  "metadata": [DatapointMetadataModelMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
112
112
  "truth": AddValidationRapidModelTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None,
113
- "text": obj.get("text"),
113
+ "texts": obj.get("texts"),
114
114
  "randomCorrectProbability": obj.get("randomCorrectProbability")
115
115
  })
116
116
  return _obj
@@ -18,7 +18,7 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
- from typing import Any, ClassVar, Dict, List
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
24
24
 
@@ -26,9 +26,8 @@ class CreateClientModel(BaseModel):
26
26
  """
27
27
  The model for creating a new client.
28
28
  """ # noqa: E501
29
- name: StrictStr = Field(description="A human-readable name for the client used for easy identification.")
30
- customer_id: StrictStr = Field(description="The id of the customer that owns the client.", alias="customerId")
31
- __properties: ClassVar[List[str]] = ["name", "customerId"]
29
+ display_name: Optional[StrictStr] = Field(default=None, description="An optional display name for the client.", alias="displayName")
30
+ __properties: ClassVar[List[str]] = ["displayName"]
32
31
 
33
32
  model_config = ConfigDict(
34
33
  populate_by_name=True,
@@ -69,6 +68,11 @@ class CreateClientModel(BaseModel):
69
68
  exclude=excluded_fields,
70
69
  exclude_none=True,
71
70
  )
71
+ # set to None if display_name (nullable) is None
72
+ # and model_fields_set contains the field
73
+ if self.display_name is None and "display_name" in self.model_fields_set:
74
+ _dict['displayName'] = None
75
+
72
76
  return _dict
73
77
 
74
78
  @classmethod
@@ -81,8 +85,7 @@ class CreateClientModel(BaseModel):
81
85
  return cls.model_validate(obj)
82
86
 
83
87
  _obj = cls.model_validate({
84
- "name": obj.get("name"),
85
- "customerId": obj.get("customerId")
88
+ "displayName": obj.get("displayName")
86
89
  })
87
90
  return _obj
88
91
 
@@ -0,0 +1,89 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class CreateClientResult(BaseModel):
26
+ """
27
+ CreateClientResult
28
+ """ # noqa: E501
29
+ client_id: StrictStr = Field(alias="clientId")
30
+ client_secret: StrictStr = Field(alias="clientSecret")
31
+ __properties: ClassVar[List[str]] = ["clientId", "clientSecret"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of CreateClientResult from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of CreateClientResult from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({
84
+ "clientId": obj.get("clientId"),
85
+ "clientSecret": obj.get("clientSecret")
86
+ })
87
+ return _obj
88
+
89
+
@@ -26,7 +26,7 @@ class CreateComplexOrderResult(BaseModel):
26
26
  """
27
27
  CreateComplexOrderResult
28
28
  """ # noqa: E501
29
- dataset_id: StrictStr = Field(alias="datasetId")
29
+ dataset_id: Optional[StrictStr] = Field(default=None, alias="datasetId")
30
30
  order_id: StrictStr = Field(alias="orderId")
31
31
  campaign_id: Optional[StrictStr] = Field(default=None, alias="campaignId")
32
32
  __properties: ClassVar[List[str]] = ["datasetId", "orderId", "campaignId"]
@@ -70,6 +70,11 @@ class CreateComplexOrderResult(BaseModel):
70
70
  exclude=excluded_fields,
71
71
  exclude_none=True,
72
72
  )
73
+ # set to None if dataset_id (nullable) is None
74
+ # and model_fields_set contains the field
75
+ if self.dataset_id is None and "dataset_id" in self.model_fields_set:
76
+ _dict['datasetId'] = None
77
+
73
78
  # set to None if campaign_id (nullable) is None
74
79
  # and model_fields_set contains the field
75
80
  if self.campaign_id is None and "campaign_id" in self.model_fields_set: