001package ca.uhn.fhir.rest.server.interceptor.auth;
002
003import org.hl7.fhir.instance.model.api.IIdType;
004
005import java.util.Collection;
006
007/*
008 * #%L
009 * HAPI FHIR - Server Framework
010 * %%
011 * Copyright (C) 2014 - 2023 Smile CDR, Inc.
012 * %%
013 * Licensed under the Apache License, Version 2.0 (the "License");
014 * you may not use this file except in compliance with the License.
015 * You may obtain a copy of the License at
016 *
017 *      http://www.apache.org/licenses/LICENSE-2.0
018 *
019 * Unless required by applicable law or agreed to in writing, software
020 * distributed under the License is distributed on an "AS IS" BASIS,
021 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
022 * See the License for the specific language governing permissions and
023 * limitations under the License.
024 * #L%
025 */
026
027public interface IAuthRuleBuilderRuleOp extends IAuthRuleBuilderAppliesTo<IAuthRuleBuilderRuleOpClassifier> {
028
029        /**
030         * Rule applies to the resource with the given ID (e.g. <code>Patient/123</code>)
031         * <p>
032         * See the following examples which show how theId is interpreted:
033         * </p>
034         * <ul>
035         * <li><b><code>http://example.com/Patient/123</code></b> - Any Patient resource with the ID "123" will be matched (note: the base URL part is ignored)</li>
036         * <li><b><code>Patient/123</code></b> - Any Patient resource with the ID "123" will be matched</li>
037         * <li><b><code>123</code></b> - Any resource of any type with the ID "123" will be matched</li>
038         * </ul>
039         *
040         * @param theId The ID of the resource to apply  (e.g. <code>Patient/123</code>)
041         * @throws IllegalArgumentException If theId does not contain an ID with at least an ID part
042         * @throws NullPointerException     If theId is null
043         */
044        IAuthRuleFinished instance(String theId);
045
046        /**
047         * Rule applies to the resource with the given ID (e.g. <code>Patient/123</code>)
048         * <p>
049         * See the following examples which show how theId is interpreted:
050         * </p>
051         * <ul>
052         * <li><b><code>http://example.com/Patient/123</code></b> - Any Patient resource with the ID "123" will be matched (note: the base URL part is ignored)</li>
053         * <li><b><code>Patient/123</code></b> - Any Patient resource with the ID "123" will be matched</li>
054         * <li><b><code>123</code></b> - Any resource of any type with the ID "123" will be matched</li>
055         * </ul>
056         >*
057         * @param theId The ID of the resource to apply  (e.g. <code>Patient/123</code>)
058         * @throws IllegalArgumentException If theId does not contain an ID with at least an ID part
059         * @throws NullPointerException     If theId is null
060         */
061        IAuthRuleFinished instance(IIdType theId);
062
063        /**
064         * Rule applies to the resource with the given ID (e.g. <code>Patient/123</code>)
065         * <p>
066         * See the following examples which show how theId is interpreted:
067         * </p>
068         * <ul>
069         * <li><b><code>http://example.com/Patient/123</code></b> - Any Patient resource with the ID "123" will be matched (note: the base URL part is ignored)</li>
070         * <li><b><code>Patient/123</code></b> - Any Patient resource with the ID "123" will be matched</li>
071         * <li><b><code>123</code></b> - Any resource of any type with the ID "123" will be matched</li>
072         * </ul>
073         *
074         * @param theIds The IDs of the resource to apply  (e.g. <code>Patient/123</code>)
075         * @throws IllegalArgumentException If theId does not contain an ID with at least an ID part
076         * @throws NullPointerException     If theId is null
077         */
078        IAuthRuleFinished instances(Collection<IIdType> theIds);
079
080}