azure_cognitiveservices_personalizer 0.17.0

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 (22) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/azure_cognitiveservices_personalizer.rb +6 -0
  4. data/lib/module_definition.rb +7 -0
  5. data/lib/profiles/latest/modules/personalizer_profile_module.rb +95 -0
  6. data/lib/profiles/latest/personalizer_latest_profile_client.rb +38 -0
  7. data/lib/profiles/latest/personalizer_module_definition.rb +8 -0
  8. data/lib/v1.0/generated/azure_cognitiveservices_personalizer.rb +37 -0
  9. data/lib/v1.0/generated/azure_cognitiveservices_personalizer/events.rb +204 -0
  10. data/lib/v1.0/generated/azure_cognitiveservices_personalizer/models/error_code.rb +17 -0
  11. data/lib/v1.0/generated/azure_cognitiveservices_personalizer/models/error_response.rb +47 -0
  12. data/lib/v1.0/generated/azure_cognitiveservices_personalizer/models/internal_error.rb +59 -0
  13. data/lib/v1.0/generated/azure_cognitiveservices_personalizer/models/personalizer_error.rb +103 -0
  14. data/lib/v1.0/generated/azure_cognitiveservices_personalizer/models/rank_request.rb +141 -0
  15. data/lib/v1.0/generated/azure_cognitiveservices_personalizer/models/rank_response.rb +91 -0
  16. data/lib/v1.0/generated/azure_cognitiveservices_personalizer/models/rankable_action.rb +68 -0
  17. data/lib/v1.0/generated/azure_cognitiveservices_personalizer/models/ranked_action.rb +66 -0
  18. data/lib/v1.0/generated/azure_cognitiveservices_personalizer/models/reward_request.rb +47 -0
  19. data/lib/v1.0/generated/azure_cognitiveservices_personalizer/module_definition.rb +9 -0
  20. data/lib/v1.0/generated/azure_cognitiveservices_personalizer/personalizer_client.rb +226 -0
  21. data/lib/version.rb +7 -0
  22. metadata +137 -0
@@ -0,0 +1,47 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CognitiveServices::Personalizer::V1_0
7
+ module Models
8
+ #
9
+ # Used to return an error to the client
10
+ #
11
+ class ErrorResponse
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [PersonalizerError] The error object.
16
+ attr_accessor :error
17
+
18
+
19
+ #
20
+ # Mapper for ErrorResponse class as Ruby Hash.
21
+ # This will be used for serialization/deserialization.
22
+ #
23
+ def self.mapper()
24
+ {
25
+ client_side_validation: true,
26
+ required: false,
27
+ serialized_name: 'ErrorResponse',
28
+ type: {
29
+ name: 'Composite',
30
+ class_name: 'ErrorResponse',
31
+ model_properties: {
32
+ error: {
33
+ client_side_validation: true,
34
+ required: true,
35
+ serialized_name: 'error',
36
+ type: {
37
+ name: 'Composite',
38
+ class_name: 'PersonalizerError'
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,59 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CognitiveServices::Personalizer::V1_0
7
+ module Models
8
+ #
9
+ # An object containing more specific information than the parent object
10
+ # about the error.
11
+ #
12
+ class InternalError
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [String] Detailed error code.
17
+ attr_accessor :code
18
+
19
+ # @return [InternalError] The error object.
20
+ attr_accessor :innererror
21
+
22
+
23
+ #
24
+ # Mapper for InternalError class as Ruby Hash.
25
+ # This will be used for serialization/deserialization.
26
+ #
27
+ def self.mapper()
28
+ {
29
+ client_side_validation: true,
30
+ required: false,
31
+ serialized_name: 'InternalError',
32
+ type: {
33
+ name: 'Composite',
34
+ class_name: 'InternalError',
35
+ model_properties: {
36
+ code: {
37
+ client_side_validation: true,
38
+ required: false,
39
+ serialized_name: 'code',
40
+ type: {
41
+ name: 'String'
42
+ }
43
+ },
44
+ innererror: {
45
+ client_side_validation: true,
46
+ required: false,
47
+ serialized_name: 'innererror',
48
+ type: {
49
+ name: 'Composite',
50
+ class_name: 'InternalError'
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,103 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CognitiveServices::Personalizer::V1_0
7
+ module Models
8
+ #
9
+ # The error object.
10
+ #
11
+ class PersonalizerError
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [ErrorCode] High level error code. Possible values include:
16
+ # 'BadRequest', 'ResourceNotFound', 'InternalServerError'
17
+ attr_accessor :code
18
+
19
+ # @return [String] A message explaining the error reported by the
20
+ # service.
21
+ attr_accessor :message
22
+
23
+ # @return [String] Error source element.
24
+ attr_accessor :target
25
+
26
+ # @return [Array<PersonalizerError>] An array of details about specific
27
+ # errors that led to this reported error.
28
+ attr_accessor :details
29
+
30
+ # @return [InternalError] Finer error details.
31
+ attr_accessor :inner_error
32
+
33
+
34
+ #
35
+ # Mapper for PersonalizerError class as Ruby Hash.
36
+ # This will be used for serialization/deserialization.
37
+ #
38
+ def self.mapper()
39
+ {
40
+ client_side_validation: true,
41
+ required: false,
42
+ serialized_name: 'PersonalizerError',
43
+ type: {
44
+ name: 'Composite',
45
+ class_name: 'PersonalizerError',
46
+ model_properties: {
47
+ code: {
48
+ client_side_validation: true,
49
+ required: true,
50
+ serialized_name: 'code',
51
+ type: {
52
+ name: 'String'
53
+ }
54
+ },
55
+ message: {
56
+ client_side_validation: true,
57
+ required: true,
58
+ serialized_name: 'message',
59
+ type: {
60
+ name: 'String'
61
+ }
62
+ },
63
+ target: {
64
+ client_side_validation: true,
65
+ required: false,
66
+ serialized_name: 'target',
67
+ type: {
68
+ name: 'String'
69
+ }
70
+ },
71
+ details: {
72
+ client_side_validation: true,
73
+ required: false,
74
+ serialized_name: 'details',
75
+ type: {
76
+ name: 'Sequence',
77
+ element: {
78
+ client_side_validation: true,
79
+ required: false,
80
+ serialized_name: 'PersonalizerErrorElementType',
81
+ type: {
82
+ name: 'Composite',
83
+ class_name: 'PersonalizerError'
84
+ }
85
+ }
86
+ }
87
+ },
88
+ inner_error: {
89
+ client_side_validation: true,
90
+ required: false,
91
+ serialized_name: 'innerError',
92
+ type: {
93
+ name: 'Composite',
94
+ class_name: 'InternalError'
95
+ }
96
+ }
97
+ }
98
+ }
99
+ }
100
+ end
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,141 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CognitiveServices::Personalizer::V1_0
7
+ module Models
8
+ #
9
+ # Request a set of actions to be ranked by the Personalizer service.
10
+ #
11
+ class RankRequest
12
+
13
+ include MsRestAzure
14
+
15
+ # @return Features of the context used for Personalizer as a
16
+ # dictionary of dictionaries. This depends on the application, and
17
+ # typically includes features about the current user, their
18
+ # device, profile information, data about time and date, etc.
19
+ attr_accessor :context_features
20
+
21
+ # @return [Array<RankableAction>] The set of actions the Personalizer
22
+ # service can pick from.
23
+ # The set should not contain more than 50 actions.
24
+ # The order of the actions does not affect the rank result but the order
25
+ # should match the sequence your application would have used to display
26
+ # them.
27
+ attr_accessor :actions
28
+
29
+ # @return [Array<String>] The set of action ids to exclude from ranking.
30
+ attr_accessor :excluded_actions
31
+
32
+ # @return [String] Optionally pass an eventId that uniquely identifies
33
+ # this Rank event.
34
+ # If null, the service generates a unique eventId. The eventId will be
35
+ # used for
36
+ # associating this request with its reward, as well as seeding the
37
+ # pseudo-random
38
+ # generator when making a Personalizer call.
39
+ attr_accessor :event_id
40
+
41
+ # @return [Boolean] Send false if the user will see the rank results,
42
+ # therefore
43
+ # Personalizer will expect a Reward call, otherwise it will assign the
44
+ # default
45
+ # Reward to the event. Send true if it is possible the user will not see
46
+ # the
47
+ # rank results, because the page is rendering later, or the Rank results
48
+ # may be
49
+ # overridden by code further downstream. Default value: false .
50
+ attr_accessor :defer_activation
51
+
52
+
53
+ #
54
+ # Mapper for RankRequest class as Ruby Hash.
55
+ # This will be used for serialization/deserialization.
56
+ #
57
+ def self.mapper()
58
+ {
59
+ client_side_validation: true,
60
+ required: false,
61
+ serialized_name: 'RankRequest',
62
+ type: {
63
+ name: 'Composite',
64
+ class_name: 'RankRequest',
65
+ model_properties: {
66
+ context_features: {
67
+ client_side_validation: true,
68
+ required: false,
69
+ serialized_name: 'contextFeatures',
70
+ type: {
71
+ name: 'Sequence',
72
+ element: {
73
+ client_side_validation: true,
74
+ required: false,
75
+ serialized_name: 'ObjectElementType',
76
+ type: {
77
+ name: 'Object'
78
+ }
79
+ }
80
+ }
81
+ },
82
+ actions: {
83
+ client_side_validation: true,
84
+ required: true,
85
+ serialized_name: 'actions',
86
+ type: {
87
+ name: 'Sequence',
88
+ element: {
89
+ client_side_validation: true,
90
+ required: false,
91
+ serialized_name: 'RankableActionElementType',
92
+ type: {
93
+ name: 'Composite',
94
+ class_name: 'RankableAction'
95
+ }
96
+ }
97
+ }
98
+ },
99
+ excluded_actions: {
100
+ client_side_validation: true,
101
+ required: false,
102
+ serialized_name: 'excludedActions',
103
+ type: {
104
+ name: 'Sequence',
105
+ element: {
106
+ client_side_validation: true,
107
+ required: false,
108
+ serialized_name: 'StringElementType',
109
+ type: {
110
+ name: 'String'
111
+ }
112
+ }
113
+ }
114
+ },
115
+ event_id: {
116
+ client_side_validation: true,
117
+ required: false,
118
+ serialized_name: 'eventId',
119
+ constraints: {
120
+ MaxLength: 256
121
+ },
122
+ type: {
123
+ name: 'String'
124
+ }
125
+ },
126
+ defer_activation: {
127
+ client_side_validation: true,
128
+ required: false,
129
+ serialized_name: 'deferActivation',
130
+ default_value: false,
131
+ type: {
132
+ name: 'Boolean'
133
+ }
134
+ }
135
+ }
136
+ }
137
+ }
138
+ end
139
+ end
140
+ end
141
+ end
@@ -0,0 +1,91 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CognitiveServices::Personalizer::V1_0
7
+ module Models
8
+ #
9
+ # A resulting ordered list of actions that result from a rank request.
10
+ #
11
+ class RankResponse
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Array<RankedAction>] The calculated ranking for the current
16
+ # request.
17
+ attr_accessor :ranking
18
+
19
+ # @return [String] The eventId for the round trip from request to
20
+ # response.
21
+ attr_accessor :event_id
22
+
23
+ # @return [String] The action chosen by the Personalizer service. This is
24
+ # the action for which to report the reward. This might not be the
25
+ # first found in 'ranking' if an action in the request in first position
26
+ # was part of the excluded ids.
27
+ attr_accessor :reward_action_id
28
+
29
+
30
+ #
31
+ # Mapper for RankResponse class as Ruby Hash.
32
+ # This will be used for serialization/deserialization.
33
+ #
34
+ def self.mapper()
35
+ {
36
+ client_side_validation: true,
37
+ required: false,
38
+ serialized_name: 'RankResponse',
39
+ type: {
40
+ name: 'Composite',
41
+ class_name: 'RankResponse',
42
+ model_properties: {
43
+ ranking: {
44
+ client_side_validation: true,
45
+ required: false,
46
+ read_only: true,
47
+ serialized_name: 'ranking',
48
+ type: {
49
+ name: 'Sequence',
50
+ element: {
51
+ client_side_validation: true,
52
+ required: false,
53
+ serialized_name: 'RankedActionElementType',
54
+ type: {
55
+ name: 'Composite',
56
+ class_name: 'RankedAction'
57
+ }
58
+ }
59
+ }
60
+ },
61
+ event_id: {
62
+ client_side_validation: true,
63
+ required: false,
64
+ read_only: true,
65
+ serialized_name: 'eventId',
66
+ constraints: {
67
+ MaxLength: 256
68
+ },
69
+ type: {
70
+ name: 'String'
71
+ }
72
+ },
73
+ reward_action_id: {
74
+ client_side_validation: true,
75
+ required: false,
76
+ read_only: true,
77
+ serialized_name: 'rewardActionId',
78
+ constraints: {
79
+ MaxLength: 256
80
+ },
81
+ type: {
82
+ name: 'String'
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,68 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CognitiveServices::Personalizer::V1_0
7
+ module Models
8
+ #
9
+ # An action with it's associated features used for ranking.
10
+ #
11
+ class RankableAction
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Id of the action.
16
+ attr_accessor :id
17
+
18
+ # @return List of dictionaries containing features.
19
+ attr_accessor :features
20
+
21
+
22
+ #
23
+ # Mapper for RankableAction class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ client_side_validation: true,
29
+ required: false,
30
+ serialized_name: 'RankableAction',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'RankableAction',
34
+ model_properties: {
35
+ id: {
36
+ client_side_validation: true,
37
+ required: true,
38
+ serialized_name: 'id',
39
+ constraints: {
40
+ MaxLength: 256
41
+ },
42
+ type: {
43
+ name: 'String'
44
+ }
45
+ },
46
+ features: {
47
+ client_side_validation: true,
48
+ required: true,
49
+ serialized_name: 'features',
50
+ type: {
51
+ name: 'Sequence',
52
+ element: {
53
+ client_side_validation: true,
54
+ required: false,
55
+ serialized_name: 'ObjectElementType',
56
+ type: {
57
+ name: 'Object'
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+ }
65
+ end
66
+ end
67
+ end
68
+ end