File: models.py

package info (click to toggle)
azure-devops-cli-extension 1.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,384 kB
  • sloc: python: 160,782; xml: 198; makefile: 56; sh: 51
file content (195 lines) | stat: -rw-r--r-- 9,200 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# Generated file, DO NOT EDIT
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------------------------

from msrest.serialization import Model


class AuditLogEntry(Model):
    """
    :param action_id: The action if for the event, i.e Git.CreateRepo, Project.RenameProject
    :type action_id: str
    :param activity_id: ActivityId
    :type activity_id: str
    :param actor_cUID: The Actor's CUID
    :type actor_cUID: str
    :param actor_user_id: The Actor's User Id
    :type actor_user_id: str
    :param authentication_mechanism: Type of authentication used by the author
    :type authentication_mechanism: str
    :param correlation_id: This allows us to group things together, like one user action that caused a cascade of event entries (project creation).
    :type correlation_id: str
    :param data: External data such as CUIDs, item names, etc.
    :type data: dict
    :param id: EventId, should be unique
    :type id: str
    :param ip_address: IP Address where the event was originated
    :type ip_address: str
    :param scope_id: The org, collection or project Id
    :type scope_id: str
    :param scope_type: The type of the scope, Enterprise, Organization or Project
    :type scope_type: object
    :param timestamp: The time when the event occurred in UTC
    :type timestamp: datetime
    :param user_agent: The user agent from the request
    :type user_agent: str
    """

    _attribute_map = {
        'action_id': {'key': 'actionId', 'type': 'str'},
        'activity_id': {'key': 'activityId', 'type': 'str'},
        'actor_cUID': {'key': 'actorCUID', 'type': 'str'},
        'actor_user_id': {'key': 'actorUserId', 'type': 'str'},
        'authentication_mechanism': {'key': 'authenticationMechanism', 'type': 'str'},
        'correlation_id': {'key': 'correlationId', 'type': 'str'},
        'data': {'key': 'data', 'type': '{object}'},
        'id': {'key': 'id', 'type': 'str'},
        'ip_address': {'key': 'ipAddress', 'type': 'str'},
        'scope_id': {'key': 'scopeId', 'type': 'str'},
        'scope_type': {'key': 'scopeType', 'type': 'object'},
        'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
        'user_agent': {'key': 'userAgent', 'type': 'str'}
    }

    def __init__(self, action_id=None, activity_id=None, actor_cUID=None, actor_user_id=None, authentication_mechanism=None, correlation_id=None, data=None, id=None, ip_address=None, scope_id=None, scope_type=None, timestamp=None, user_agent=None):
        super(AuditLogEntry, self).__init__()
        self.action_id = action_id
        self.activity_id = activity_id
        self.actor_cUID = actor_cUID
        self.actor_user_id = actor_user_id
        self.authentication_mechanism = authentication_mechanism
        self.correlation_id = correlation_id
        self.data = data
        self.id = id
        self.ip_address = ip_address
        self.scope_id = scope_id
        self.scope_type = scope_type
        self.timestamp = timestamp
        self.user_agent = user_agent


class AuditLogQueryResult(Model):
    """
    The object returned when the audit log is queried. It contains the log and the information needed to query more audit entries.

    :param continuation_token: The continuation token to pass to get the next set of results
    :type continuation_token: str
    :param decorated_audit_log_entries: The list of audit log entries
    :type decorated_audit_log_entries: list of :class:`DecoratedAuditLogEntry <azure.devops.v5_1.audit.models.DecoratedAuditLogEntry>`
    :param has_more: True when there are more matching results to be fetched, false otherwise.
    :type has_more: bool
    """

    _attribute_map = {
        'continuation_token': {'key': 'continuationToken', 'type': 'str'},
        'decorated_audit_log_entries': {'key': 'decoratedAuditLogEntries', 'type': '[DecoratedAuditLogEntry]'},
        'has_more': {'key': 'hasMore', 'type': 'bool'}
    }

    def __init__(self, continuation_token=None, decorated_audit_log_entries=None, has_more=None):
        super(AuditLogQueryResult, self).__init__()
        self.continuation_token = continuation_token
        self.decorated_audit_log_entries = decorated_audit_log_entries
        self.has_more = has_more


class DecoratedAuditLogEntry(Model):
    """
    :param action_id: The action if for the event, i.e Git.CreateRepo, Project.RenameProject
    :type action_id: str
    :param activity_id: ActivityId
    :type activity_id: str
    :param actor_cUID: The Actor's CUID
    :type actor_cUID: str
    :param actor_display_name: DisplayName of the user who initiated the action
    :type actor_display_name: str
    :param actor_image_url: URL of Actor's Profile image
    :type actor_image_url: str
    :param actor_user_id: The Actor's User Id
    :type actor_user_id: str
    :param area: Area of Azure DevOps the action occurred
    :type area: str
    :param authentication_mechanism: Type of authentication used by the actor
    :type authentication_mechanism: str
    :param category: Type of action executed
    :type category: object
    :param category_display_name: DisplayName of the category
    :type category_display_name: str
    :param correlation_id: This allows related audit entries to be grouped together. Generally this occurs when a single action causes a cascade of audit entries. For example, project creation.
    :type correlation_id: str
    :param data: External data such as CUIDs, item names, etc.
    :type data: dict
    :param details: Decorated details
    :type details: str
    :param id: EventId - Needs to be unique per service
    :type id: str
    :param ip_address: IP Address where the event was originated
    :type ip_address: str
    :param scope_display_name: DisplayName of the scope
    :type scope_display_name: str
    :param scope_id: The organization or project Id
    :type scope_id: str
    :param scope_type: The type of the scope, Organization or Project
    :type scope_type: object
    :param timestamp: The time when the event occurred in UTC
    :type timestamp: datetime
    :param user_agent: The user agent from the request
    :type user_agent: str
    """

    _attribute_map = {
        'action_id': {'key': 'actionId', 'type': 'str'},
        'activity_id': {'key': 'activityId', 'type': 'str'},
        'actor_cUID': {'key': 'actorCUID', 'type': 'str'},
        'actor_display_name': {'key': 'actorDisplayName', 'type': 'str'},
        'actor_image_url': {'key': 'actorImageUrl', 'type': 'str'},
        'actor_user_id': {'key': 'actorUserId', 'type': 'str'},
        'area': {'key': 'area', 'type': 'str'},
        'authentication_mechanism': {'key': 'authenticationMechanism', 'type': 'str'},
        'category': {'key': 'category', 'type': 'object'},
        'category_display_name': {'key': 'categoryDisplayName', 'type': 'str'},
        'correlation_id': {'key': 'correlationId', 'type': 'str'},
        'data': {'key': 'data', 'type': '{object}'},
        'details': {'key': 'details', 'type': 'str'},
        'id': {'key': 'id', 'type': 'str'},
        'ip_address': {'key': 'ipAddress', 'type': 'str'},
        'scope_display_name': {'key': 'scopeDisplayName', 'type': 'str'},
        'scope_id': {'key': 'scopeId', 'type': 'str'},
        'scope_type': {'key': 'scopeType', 'type': 'object'},
        'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
        'user_agent': {'key': 'userAgent', 'type': 'str'}
    }

    def __init__(self, action_id=None, activity_id=None, actor_cUID=None, actor_display_name=None, actor_image_url=None, actor_user_id=None, area=None, authentication_mechanism=None, category=None, category_display_name=None, correlation_id=None, data=None, details=None, id=None, ip_address=None, scope_display_name=None, scope_id=None, scope_type=None, timestamp=None, user_agent=None):
        super(DecoratedAuditLogEntry, self).__init__()
        self.action_id = action_id
        self.activity_id = activity_id
        self.actor_cUID = actor_cUID
        self.actor_display_name = actor_display_name
        self.actor_image_url = actor_image_url
        self.actor_user_id = actor_user_id
        self.area = area
        self.authentication_mechanism = authentication_mechanism
        self.category = category
        self.category_display_name = category_display_name
        self.correlation_id = correlation_id
        self.data = data
        self.details = details
        self.id = id
        self.ip_address = ip_address
        self.scope_display_name = scope_display_name
        self.scope_id = scope_id
        self.scope_type = scope_type
        self.timestamp = timestamp
        self.user_agent = user_agent


__all__ = [
    'AuditLogEntry',
    'AuditLogQueryResult',
    'DecoratedAuditLogEntry',
]