<?xml version="1.0" encoding="UTF-8"?>
<resource xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
          xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
          xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
          xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
          xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
          xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">
   <name>Google Apps</name>
   <connectorRef type="c:ConnectorType">
        <filter>
            <q:text>c:connectorType = "com.evolveum.polygon.connector.googleapps.GoogleAppsConnector"</q:text>
        </filter>
   </connectorRef>
   <connectorConfiguration xmlns:icfc="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3">
      <icfc:resultsHandlerConfiguration>
         <icfc:enableFilteredResultsHandler>false</icfc:enableFilteredResultsHandler>
      </icfc:resultsHandlerConfiguration>
      <icfc:configurationProperties xmlns:icfcga="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/bundle/com.evolveum.polygon.connector-googleapps/com.evolveum.polygon.connector.googleapps.GoogleAppsConnector">
         <icfcga:domain>midpoint.ami.cz</icfcga:domain>
         <icfcga:productId>Google-Apps</icfcga:productId>
         <icfcga:skuId>Google-Apps-For-Business</icfcga:skuId>
         <icfcga:autoAddLicense>false</icfcga:autoAddLicense>
         <icfcga:clientId>secret.apps.googleusercontent.com</icfcga:clientId>
         <icfcga:clientSecret>
            <t:clearValue>secret</t:clearValue>
         </icfcga:clientSecret>
         <icfcga:refreshToken>
            <t:clearValue>secret</t:clearValue>
         </icfcga:refreshToken>
      </icfc:configurationProperties>
   </connectorConfiguration>
   <schema>
      <definition>
         <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                     xmlns:a="http://prism.evolveum.com/xml/ns/public/annotation-3"
                     xmlns:tns="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
                     xmlns:ra="http://midpoint.evolveum.com/xml/ns/public/resource/annotation-3"
                     elementFormDefault="qualified"
                     targetNamespace="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">
                        <xsd:import namespace="http://prism.evolveum.com/xml/ns/public/annotation-3"/>
                        <xsd:import namespace="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"/>
                        <xsd:import namespace="http://midpoint.evolveum.com/xml/ns/public/resource/annotation-3"/>
                        <xsd:complexType name="AccountObjectClass">
                              <xsd:annotation>
                                    <xsd:appinfo>
                                          <ra:resourceObject/>
                                          <ra:identifier>icfs:uid</ra:identifier>
                                          <ra:secondaryIdentifier>icfs:name</ra:secondaryIdentifier>
                                          <ra:displayNameAttribute>icfs:name</ra:displayNameAttribute>
                                          <ra:namingAttribute>icfs:name</ra:namingAttribute>
                                          <ra:nativeObjectClass>__ACCOUNT__</ra:nativeObjectClass>
                                          <ra:kind>account</ra:kind>
                                          <ra:default>true</ra:default>
                                    </xsd:appinfo>
                              </xsd:annotation>
                              <xsd:sequence>
                                    <xsd:element minOccurs="0" name="isMailboxSetup" type="xsd:boolean">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>120</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>isMailboxSetup</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="deletionTime" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>130</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>deletionTime</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="thumbnailPhotoUrl" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>140</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>thumbnailPhotoUrl</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element maxOccurs="unbounded"
                               minOccurs="0"
                               name="emails"
                               type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>150</a:displayOrder>
                                                      <ra:frameworkAttributeName>emails</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="customerId" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>160</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>customerId</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element maxOccurs="unbounded"
                               minOccurs="0"
                               name="aliases"
                               type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>170</a:displayOrder>
                                                      <ra:frameworkAttributeName>aliases</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="__PHOTO__" type="xsd:base64Binary">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>180</a:displayOrder>
                                                      <ra:frameworkAttributeName>__PHOTO__</ra:frameworkAttributeName>
                                                      <ra:returnedByDefault>false</ra:returnedByDefault>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element maxOccurs="unbounded"
                               minOccurs="0"
                               name="organizations"
                               type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>190</a:displayOrder>
                                                      <ra:frameworkAttributeName>organizations</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element maxOccurs="unbounded"
                               minOccurs="0"
                               name="creationTime"
                               type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>200</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>creationTime</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element maxOccurs="unbounded"
                               minOccurs="0"
                               name="phones"
                               type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>210</a:displayOrder>
                                                      <ra:frameworkAttributeName>phones</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element ref="icfs:name">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayName>ConnId Name</a:displayName>
                                                      <a:displayOrder>110</a:displayOrder>
                                                      <ra:frameworkAttributeName>__NAME__</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="fullName" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>220</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>fullName</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element name="givenName" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>230</a:displayOrder>
                                                      <ra:frameworkAttributeName>givenName</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="isDelegatedAdmin" type="xsd:boolean">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>240</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>isDelegatedAdmin</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element maxOccurs="unbounded"
                               minOccurs="0"
                               name="nonEditableAliases"
                               type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>250</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>nonEditableAliases</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="agreedToTerms" type="xsd:boolean">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>260</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>agreedToTerms</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element maxOccurs="unbounded"
                               minOccurs="0"
                               name="lastLoginTime"
                               type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>270</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>lastLoginTime</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="ipWhitelisted" type="xsd:boolean">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>280</a:displayOrder>
                                                      <ra:frameworkAttributeName>ipWhitelisted</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element maxOccurs="unbounded"
                               minOccurs="0"
                               name="ims"
                               type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>290</a:displayOrder>
                                                      <ra:frameworkAttributeName>ims</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element maxOccurs="unbounded" minOccurs="0" ref="icfs:groups">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>300</a:displayOrder>
                                                      <ra:frameworkAttributeName>__GROUPS__</ra:frameworkAttributeName>
                                                      <ra:returnedByDefault>false</ra:returnedByDefault>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="changePasswordAtNextLogin" type="xsd:boolean">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>310</a:displayOrder>
                                                      <ra:frameworkAttributeName>changePasswordAtNextLogin</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element maxOccurs="unbounded"
                               minOccurs="0"
                               name="externalIds"
                               type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>320</a:displayOrder>
                                                      <ra:frameworkAttributeName>externalIds</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element maxOccurs="unbounded"
                               minOccurs="0"
                               name="relations"
                               type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>330</a:displayOrder>
                                                      <ra:frameworkAttributeName>relations</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="suspended" type="xsd:boolean">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                    <a:ignore>true</a:ignore>
                                                      <a:displayOrder>340</a:displayOrder>
                                                      <ra:frameworkAttributeName>suspended</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="isAdmin" type="xsd:boolean">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>350</a:displayOrder>
                                                      <ra:frameworkAttributeName>isAdmin</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="orgUnitPath" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>360</a:displayOrder>
                                                      <ra:frameworkAttributeName>orgUnitPath</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element maxOccurs="unbounded"
                               minOccurs="0"
                               name="addresses"
                               type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>370</a:displayOrder>
                                                      <ra:frameworkAttributeName>addresses</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="includeInGlobalAddressList" type="xsd:boolean">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>380</a:displayOrder>
                                                      <ra:frameworkAttributeName>includeInGlobalAddressList</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element name="familyName" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>390</a:displayOrder>
                                                      <ra:frameworkAttributeName>familyName</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="suspensionReason" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>400</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>suspensionReason</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" ref="icfs:uid">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayName>ConnId UID</a:displayName>
                                                      <a:displayOrder>100</a:displayOrder>
                                                      <a:access>read</a:access>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                              </xsd:sequence>
                        </xsd:complexType>
                        <xsd:complexType name="CustomOrgUnitObjectClass">
                              <xsd:annotation>
                                    <xsd:appinfo>
                                          <ra:resourceObject/>
                                          <ra:identifier>icfs:uid</ra:identifier>
                                          <ra:secondaryIdentifier>icfs:name</ra:secondaryIdentifier>
                                          <ra:displayNameAttribute>icfs:name</ra:displayNameAttribute>
                                          <ra:namingAttribute>icfs:name</ra:namingAttribute>
                                          <ra:nativeObjectClass>OrgUnit</ra:nativeObjectClass>
                                    </xsd:appinfo>
                              </xsd:annotation>
                              <xsd:sequence>
                                    <xsd:element minOccurs="0" ref="icfs:description">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>120</a:displayOrder>
                                                      <ra:frameworkAttributeName>__DESCRIPTION__</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="blockInheritance" type="xsd:boolean">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>130</a:displayOrder>
                                                      <ra:frameworkAttributeName>blockInheritance</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="orgUnitPath" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>140</a:displayOrder>
                                                      <ra:frameworkAttributeName>orgUnitPath</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element ref="icfs:name">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayName>ConnId Name</a:displayName>
                                                      <a:displayOrder>110</a:displayOrder>
                                                      <ra:frameworkAttributeName>__NAME__</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element name="parentOrgUnitPath" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>150</a:displayOrder>
                                                      <ra:frameworkAttributeName>parentOrgUnitPath</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" ref="icfs:uid">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayName>ConnId UID</a:displayName>
                                                      <a:displayOrder>100</a:displayOrder>
                                                      <a:access>read</a:access>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                              </xsd:sequence>
                        </xsd:complexType>
                        <xsd:complexType name="GroupObjectClass">
                              <xsd:annotation>
                                    <xsd:appinfo>
                                          <ra:resourceObject/>
                                          <ra:identifier>icfs:uid</ra:identifier>
                                          <ra:secondaryIdentifier>icfs:name</ra:secondaryIdentifier>
                                          <ra:displayNameAttribute>icfs:name</ra:displayNameAttribute>
                                          <ra:namingAttribute>icfs:name</ra:namingAttribute>
                                          <ra:nativeObjectClass>__GROUP__</ra:nativeObjectClass>
                                    </xsd:appinfo>
                              </xsd:annotation>
                              <xsd:sequence>
                                    <xsd:element minOccurs="0" ref="icfs:description">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>120</a:displayOrder>
                                                      <ra:frameworkAttributeName>__DESCRIPTION__</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element maxOccurs="unbounded"
                               minOccurs="0"
                               name="__MEMBERS__"
                               type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>130</a:displayOrder>
                                                      <ra:frameworkAttributeName>__MEMBERS__</ra:frameworkAttributeName>
                                                      <ra:returnedByDefault>false</ra:returnedByDefault>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element maxOccurs="unbounded"
                               minOccurs="0"
                               name="nonEditableAliases"
                               type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>140</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>nonEditableAliases</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="directMembersCount" type="xsd:long">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>150</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>directMembersCount</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="adminCreated" type="xsd:boolean">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>160</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>adminCreated</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element maxOccurs="unbounded"
                               minOccurs="0"
                               name="aliases"
                               type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>170</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>aliases</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element ref="icfs:name">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayName>ConnId Name</a:displayName>
                                                      <a:displayOrder>110</a:displayOrder>
                                                      <ra:frameworkAttributeName>__NAME__</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="name" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>180</a:displayOrder>
                                                      <ra:frameworkAttributeName>name</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" ref="icfs:uid">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayName>ConnId UID</a:displayName>
                                                      <a:displayOrder>100</a:displayOrder>
                                                      <a:access>read</a:access>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                              </xsd:sequence>
                        </xsd:complexType>
                        <xsd:complexType name="CustomLicenseAssignmentObjectClass">
                              <xsd:annotation>
                                    <xsd:appinfo>
                                          <ra:resourceObject/>
                                          <ra:identifier>icfs:uid</ra:identifier>
                                          <ra:secondaryIdentifier>icfs:name</ra:secondaryIdentifier>
                                          <ra:displayNameAttribute>icfs:name</ra:displayNameAttribute>
                                          <ra:namingAttribute>icfs:name</ra:namingAttribute>
                                          <ra:nativeObjectClass>LicenseAssignment</ra:nativeObjectClass>
                                    </xsd:appinfo>
                              </xsd:annotation>
                              <xsd:sequence>
                                    <xsd:element name="userId" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>120</a:displayOrder>
                                                      <ra:frameworkAttributeName>userId</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element ref="icfs:name">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayName>ConnId Name</a:displayName>
                                                      <a:displayOrder>110</a:displayOrder>
                                                      <ra:frameworkAttributeName>__NAME__</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="selfLink" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>130</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>selfLink</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element name="productId" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>140</a:displayOrder>
                                                      <ra:frameworkAttributeName>productId</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element name="skuId" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>150</a:displayOrder>
                                                      <ra:frameworkAttributeName>skuId</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" ref="icfs:uid">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayName>ConnId UID</a:displayName>
                                                      <a:displayOrder>100</a:displayOrder>
                                                      <a:access>read</a:access>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                              </xsd:sequence>
                        </xsd:complexType>
                        <xsd:complexType name="CustomMemberObjectClass">
                              <xsd:annotation>
                                    <xsd:appinfo>
                                          <ra:resourceObject/>
                                          <ra:identifier>icfs:uid</ra:identifier>
                                          <ra:secondaryIdentifier>icfs:name</ra:secondaryIdentifier>
                                          <ra:displayNameAttribute>icfs:name</ra:displayNameAttribute>
                                          <ra:namingAttribute>icfs:name</ra:namingAttribute>
                                          <ra:nativeObjectClass>Member</ra:nativeObjectClass>
                                    </xsd:appinfo>
                              </xsd:annotation>
                              <xsd:sequence>
                                    <xsd:element minOccurs="0" name="role" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>120</a:displayOrder>
                                                      <ra:frameworkAttributeName>role</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element name="groupKey" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>130</a:displayOrder>
                                                      <a:access>create</a:access>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>groupKey</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" ref="icfs:name">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayName>ConnId Name</a:displayName>
                                                      <a:displayOrder>110</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>__NAME__</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element name="email" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>140</a:displayOrder>
                                                      <a:access>create</a:access>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>email</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" name="type" type="xsd:string">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayOrder>150</a:displayOrder>
                                                      <a:access>read</a:access>
                                                      <ra:frameworkAttributeName>type</ra:frameworkAttributeName>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                                    <xsd:element minOccurs="0" ref="icfs:uid">
                                          <xsd:annotation>
                                                <xsd:appinfo>
                                                      <a:displayName>ConnId UID</a:displayName>
                                                      <a:displayOrder>100</a:displayOrder>
                                                      <a:access>read</a:access>
                                                </xsd:appinfo>
                                          </xsd:annotation>
                                    </xsd:element>
                              </xsd:sequence>
                        </xsd:complexType>
                  </xsd:schema>
      </definition>
   </schema>
   <schemaHandling>
      <objectType>
         <kind>entitlement</kind>
         <default>true</default>
         <objectClass>ri:GroupObjectClass</objectClass>
      </objectType>
      <objectType>
         <kind>account</kind>
         <displayName>GA Account</displayName>
         <default>true</default>
         <objectClass>ri:AccountObjectClass</objectClass>
         <attribute>
            <c:ref>icfs:name</c:ref>
            <displayName>Login</displayName>
            <outbound>
               <source>
                  <c:path>$user/emailAddress</c:path>
               </source>
            </outbound>
         </attribute>
         <attribute>
            <c:ref>ri:givenName</c:ref>
            <displayName>Given Name</displayName>
            <outbound>
               <source>
                  <c:path>$user/givenName</c:path>
               </source>
            </outbound>
         </attribute>
         <attribute>
            <c:ref>ri:familyName</c:ref>
            <displayName>Family Name</displayName>
            <outbound>
               <source>
                  <c:path>$user/familyName</c:path>
               </source>
            </outbound>
         </attribute>
         <attribute>
            <c:ref>icfs:uid</c:ref>
            <displayName>ICF UID</displayName>
            <limitations>
               <layer>presentation</layer>
               <processing>ignore</processing>
            </limitations>
         </attribute>

        <activation>
                 <administrativeStatus>
               <outbound>
                  <strength>strong</strength>
                  <expression>
                     <variable>
                        <name xmlns:my="http://whatever.com/my">my:admStatus</name>
                        <c:path>$user/activation/administrativeStatus</c:path>
                     </variable>
                     <script>
                        <language>http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy</language>
                        <code>
                            import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType;
                            if (legal) {
                                              if (admStatus?.value) {
                                                  if (admStatus.value.toUpperCase().equals('DISABLED')) {
                                                      ActivationStatusType.DISABLED;
                                                  } else {
                                                      input;
                                                  }
                                              } else {
                                                  input;
                                              }
                            } else {
                                              ActivationStatusType.DISABLED;
                            }
                        </code>
                     </script>
                  </expression>
               </outbound>
            </administrativeStatus>
            </activation>

        <credentials>
            <password>
                <outbound/>
            </password>
        </credentials>
      </objectType>
   </schemaHandling>

   <capabilities>
      <native xmlns:cap="http://midpoint.evolveum.com/xml/ns/public/resource/capabilities-3">
         <cap:credentials>
            <cap:password>
               <cap:returnedByDefault>false</cap:returnedByDefault>
            </cap:password>
         </cap:credentials>
         <cap:testConnection/>
         <cap:create/>
         <cap:read/>
         <cap:update/>
         <cap:delete/>
         <cap:script>
            <cap:host>
               <cap:type>connector</cap:type>
            </cap:host>
         </cap:script>
         <cap:pagedSearch/>
      </native>
      <configured xmlns:cap="http://midpoint.evolveum.com/xml/ns/public/resource/capabilities-3">
         <cap:create>
            <cap:enabled>true</cap:enabled>
         </cap:create>
         <cap:read>
            <cap:enabled>true</cap:enabled>
         </cap:read>
         <cap:delete>
            <cap:enabled>true</cap:enabled>
         </cap:delete>
         <cap:update>
            <cap:enabled>true</cap:enabled>
            <cap:addRemoveAttributeValues>false</cap:addRemoveAttributeValues> <!-- adding and removing values from multi-value attribute at the same time would cause problem if this is 'true'. Google API takes some small time to propagate changes between two consequent updates. -->

         </cap:update>
         <cap:credentials>
            <cap:enabled>true</cap:enabled>
            <cap:password>
               <cap:enabled>true</cap:enabled>
               <cap:returnedByDefault>false</cap:returnedByDefault>
            </cap:password>
         </cap:credentials>
         <cap:testConnection>
            <cap:enabled>true</cap:enabled>
         </cap:testConnection>
         <cap:script>
            <cap:enabled>true</cap:enabled>
            <cap:host>
               <cap:type>connector</cap:type>
            </cap:host>
         </cap:script>
         <cap:activation>
            <cap:status>
               <cap:attribute>ri:suspended</cap:attribute>
               <cap:enableValue>false</cap:enableValue>
               <cap:disableValue>true</cap:disableValue>
            </cap:status>
         </cap:activation>
      </configured>
   </capabilities>
   <synchronization>
      <objectSynchronization>
         <enabled>true</enabled>
         <correlation>
            <q:equal>
               <q:path>c:emailAddress</q:path>
               <expression>
                  <c:path>declare namespace icfs='http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3'; $account/attributes/icfs:name</c:path>
               </expression>
            </q:equal>
         </correlation>
         <reaction>
            <situation>linked</situation>
            <synchronize>true</synchronize>
            <action><handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/action-3#modifyUser</handlerUri></action>
         </reaction>
         <reaction>
            <situation>deleted</situation>
            <action><handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/action-3#unlinkAccount</handlerUri></action>
         </reaction>
         <reaction>
            <situation>unlinked</situation>
            <action><handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/action-3#linkAccount</handlerUri></action>
         </reaction>
         <reaction>
            <situation>unmatched</situation>
         </reaction>
      </objectSynchronization>
   </synchronization>
</resource>
