test: Add test for isds_FindDataBox()
[libisds.git] / test / simline / services.h
blob1eb2ab990ec61af75b1264d39e12aa2a90aaebac
1 #ifndef __ISDS_SERVICES_H
2 #define __ISDS_SERVICES_H
4 #include <time.h> /* struct tm */
5 #include <sys/time.h> /* struct timeval */
6 #include "server_types.h"
8 typedef enum {
9 SERVICE_END,
10 SERVICE_asws_changePassword_ChangePasswordOTP,
11 SERVICE_asws_changePassword_SendSMSCode,
12 SERVICE_DS_df_DataBoxCreditInfo,
13 SERVICE_DS_df_FindDataBox,
14 SERVICE_DS_df_ISDSSearch2,
15 SERVICE_DS_DsManage_ChangeISDSPassword,
16 SERVICE_DS_Dx_EraseMessage,
17 SERVICE_DS_Dz_DummyOperation,
18 SERVICE_DS_Dz_ResignISDSDocument,
19 } service_id;
21 struct service_configuration {
22 service_id name; /* Identifier of SOAP service */
23 const void *arguments; /* Configuration for the service */
26 /* Type of credit change event */
27 typedef enum {
28 SERVER_CREDIT_CHARGED, /* Credit has been charged */
29 SERVER_CREDIT_DISCHARGED, /* Credit has been discharged */
30 SERVER_CREDIT_MESSAGE_SENT, /* Credit has been spent for sending
31 a commerical message */
32 SERVER_CREDIT_STORAGE_SET, /* Credit has been spent for setting
33 a long-term storage */
34 SERVER_CREDIT_EXPIRED /* Credit has expired */
35 } server_credit_event_type;
37 /* Data specific for SERVER_CREDIT_CHARGED server_credit_event_type */
38 struct server_credit_event_charged {
39 char *transaction; /* Transaction identified;
40 NULL-terminated string. */
43 /* Data specific for SERVER_CREDIT_DISCHARGED server_credit_event_type */
44 struct server_credit_event_discharged {
45 char *transaction; /* Transaction identified;
46 NULL-terminated string. */
49 /* Data specific for SERVER_CREDIT_MESSAGE_SENT server_credit_event_type */
50 struct server_credit_event_message_sent {
51 char *recipient; /* Recipent's box ID of the sent message */
52 char *message_id; /* ID of the sent message */
55 /* Data specific for SERVER_CREDIT_STORAGE_SET server_credit_event_type */
56 struct server_credit_event_storage_set {
57 long int new_capacity; /* New storage capacity. The unit is
58 a message. */
59 struct tm *new_valid_from; /* The new capacity is available since
60 date. */
61 struct tm *new_valid_to; /* The new capacity expires on date. */
62 long int *old_capacity; /* Previous storage capacity; Optional.
63 The unit is a message. */
64 struct tm *old_valid_from; /* Date; Optional; Only tm_year,
65 tm_mon, and tm_mday carry sane value. */
66 struct tm *old_valid_to; /* Date; Optional. */
67 char *initiator; /* Name of a user who initiated this
68 change; Optional. */
71 /* Event about change of credit for sending commerical services */
72 struct server_credit_event {
73 /* Common fields */
74 struct timeval *time; /* When the credit was changed. */
75 long int credit_change; /* Difference in credit value caused by
76 this event. The unit is 1/100 CZK. */
77 long int new_credit; /* Credit value after this event.
78 The unit is 1/100 CZK. */
79 server_credit_event_type type; /* Type of the event */
81 /* Datails specific for the type */
82 union {
83 struct server_credit_event_charged charged;
84 /* SERVER_CREDIT_CHARGED */
85 struct server_credit_event_discharged discharged;
86 /* SERVER_CREDIT_DISCHAGED */
87 struct server_credit_event_message_sent message_sent;
88 /* SERVER_CREDIT_MESSAGE_SENT */
89 struct server_credit_event_storage_set storage_set;
90 /* SERVER_CREDIT_STORAGE_SET */
91 } details;
94 /* An ISDSSearch2 result */
95 struct server_db_result {
96 char *id; /* dbID value */
97 char *type; /* dbType value */
98 char *name; /* dbName value */
99 char *address; /* dbAddress value */
100 struct tm *birth_date; /* dbBiDate value */
101 char *ic; /* dbICO value */
102 _Bool ovm; /* dbEffectiveOVM value */
103 char *send_options; /* dbSendOptions value */
106 /* Union of tdbOwnerInfo and tdbPersonalOwnerInfo XSD types */
107 struct server_owner_info {
108 char *dbID;
109 _Bool *aifoIsds;
110 char *dbType;
111 char *ic;
112 char *pnFirstName;
113 char *pnMiddleName;
114 char *pnLastName;
115 char *pnLastNameAtBirth;
116 char *firmName;
117 struct tm *biDate;
118 char *biCity;
119 char *biCounty;
120 char *biState;
121 long int *adCode;
122 char *adCity;
123 char *adDistrict;
124 char *adStreet;
125 char *adNumberInStreet;
126 char *adNumberInMunicipality;
127 char *adZipCode;
128 char *adState;
129 char *nationality;
130 _Bool email_exists; /* Return empty email element */
131 char *email;
132 _Bool telNumber_exists; /* Return empty telNumber element */
133 char *telNumber;
134 char *identifier;
135 char *registryCode;
136 long int *dbState;
137 _Bool *dbEffectiveOVM;
138 _Bool *dbOpenAddressing;
141 /* General linked list */
142 struct server_list {
143 struct server_list *next; /* Next list item,
144 or NULL if current is last */
145 void *data; /* Payload */
146 void (*destructor) (void **); /* Payload deallocator;
147 Use NULL to have static data member. */
150 struct arguments_DS_df_DataBoxCreditInfo {
151 const char *status_code;
152 const char *status_message;
153 const char *box_id; /* Require this dbID in request */
154 const struct tm *from_date; /* Require this ciFromDate in request */
155 const struct tm *to_date; /* Require this ciTodate in request */
156 const long int current_credit; /* Return this currentCredit */
157 const char *email; /* Return this notifEmail */
158 const struct server_list *history; /* Return this ciRecords */
161 struct arguments_DS_df_FindDataBox {
162 const char *status_code;
163 const char *status_message;
164 const struct server_owner_info *criteria; /* generilized tDbOwnerInfo */
165 const _Bool results_exists; /* Return dbResults element */
166 const struct server_list *results; /* Return list of
167 struct server_owner_info * as
168 dbResults */
171 struct arguments_DS_df_ISDSSearch2 {
172 const char *status_code;
173 const char *status_message;
174 const char *search_text; /* Require this searchText in a request */
175 const char *search_type; /* Require this searchType in a request */
176 const char *search_scope; /* Require this searchScope in a request */
177 const long int *search_page_number; /* Require this page in a request */
178 const long int *search_page_size; /* Require this pageSize in a request */
179 const _Bool *search_highlighting_value; /* Require this highlighting
180 value in a request */
181 const unsigned long int *total_count; /* Return this totalCount */
182 const unsigned long int *current_count; /* Return this currentCount */
183 const unsigned long int *position; /* Return this position */
184 const _Bool *last_page; /* Return this lastPage */
185 const _Bool results_exists; /* Return dbResults element */
186 const struct server_list *results; /* Return list of
187 struct server_db_result* as dbResults */
190 struct arguments_DS_Dz_ResignISDSDocument {
191 const char *status_code;
192 const char *status_message;
193 const struct tm *valid_to; /* Return this date if not NULL */
196 struct arguments_DS_Dx_EraseMessage {
197 const char *message_id; /* Expected message ID */
198 _Bool incoming; /* Expected message direction,
199 true for incoming */
202 struct arguments_DS_DsManage_ChangeISDSPassword {
203 const char *username; /* User ID */
204 const char *current_password; /* User password */
207 struct arguments_asws_changePassword_ChangePasswordOTP {
208 const char *username; /* User ID */
209 const char *current_password; /* User password */
210 enum auth_otp_method method; /* OTP method */
211 const char *reference_number; /* Return this string if not NULL */
214 struct arguments_asws_changePassword_SendSMSCode {
215 const char *status_code;
216 const char *status_message;
217 const char *reference_number; /* Return this string if not NULL */
220 #endif